File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -443,21 +443,18 @@ fn find_matching_submodule(
443443/// Returns the original partial SHA if it looks like a partial SHA that would be padded,
444444/// otherwise returns the resolved SHA
445445fn get_api_sha ( original : & str , resolved : & str ) -> String {
446- // Check if original looks like a partial SHA (valid hex, 4-39 chars)
447446 let is_original_partial = original. len ( ) >= 4
448447 && original. len ( ) < 40
449448 && original. chars ( ) . all ( |c| c. is_ascii_hexdigit ( ) ) ;
450449
451- // Check if this looks like a padded partial SHA
452- // The resolved SHA should start with the original and be padded with zeros
453450 let is_resolved_padded = resolved. len ( ) == 40
454451 && resolved. starts_with ( original)
455452 && resolved[ original. len ( ) ..] . chars ( ) . all ( |c| c == '0' ) ;
456453
457454 if is_resolved_padded && is_original_partial {
458- original. to_owned ( ) // Use original partial SHA
455+ original. to_owned ( )
459456 } else {
460- resolved. to_owned ( ) // Use resolved SHA
457+ resolved. to_owned ( )
461458 }
462459}
463460
You can’t perform that action at this time.
0 commit comments