@@ -2919,6 +2919,7 @@ impl GitOperationHandler for CliGitHandler {
29192919
29202920 let mut args = vec ! [
29212921 "log" ,
2922+ "--abbrev=7" ,
29222923 "-n" ,
29232924 limit. as_str( ) ,
29242925 skip. as_str( ) ,
@@ -3671,8 +3672,10 @@ impl GitOperationHandler for CliGitHandler {
36713672
36723673 fn stash_list ( & self , request : & RepoRequest ) -> GitResult < Vec < StashEntry > > {
36733674 let repo_path = Self :: normalise_repo_path ( & request. repo_path ) ?;
3674- let output = match Self :: run_git ( & [ "stash" , "list" , "--format=%gd|%h|%s" ] , Some ( & repo_path) )
3675- {
3675+ let output = match Self :: run_git (
3676+ & [ "stash" , "list" , "--abbrev=7" , "--format=%gd|%h|%s" ] ,
3677+ Some ( & repo_path) ,
3678+ ) {
36763679 Ok ( o) => o,
36773680 Err ( GitError :: CommandFailed { stderr, .. } ) if stderr. is_empty ( ) => {
36783681 return Ok ( Vec :: new ( ) ) ;
@@ -5649,7 +5652,7 @@ impl CliGitHandler {
56495652 }
56505653
56515654 // Fallback: resolve MERGE_HEAD to a short hash
5652- Self :: run_git ( & [ "rev-parse" , "--short" , "MERGE_HEAD" ] , Some ( repo_path) )
5655+ Self :: run_git ( & [ "rev-parse" , "--short=7 " , "MERGE_HEAD" ] , Some ( repo_path) )
56535656 . ok ( )
56545657 . map ( |s| s. trim ( ) . to_string ( ) )
56555658 . filter ( |s| !s. is_empty ( ) )
@@ -5673,7 +5676,7 @@ impl CliGitHandler {
56735676 . filter ( |value| !value. is_empty ( ) )
56745677 } ) ?;
56755678
5676- Self :: run_git ( & [ "rev-parse" , "--short" , onto. as_str ( ) ] , Some ( repo_path) )
5679+ Self :: run_git ( & [ "rev-parse" , "--short=7 " , onto. as_str ( ) ] , Some ( repo_path) )
56775680 . ok ( )
56785681 . map ( |value| value. trim ( ) . to_string ( ) )
56795682 . filter ( |value| !value. is_empty ( ) )
@@ -5690,7 +5693,7 @@ impl CliGitHandler {
56905693 . map ( |value| value. trim ( ) . to_string ( ) )
56915694 . filter ( |value| !value. is_empty ( ) ) ?;
56925695
5693- Self :: run_git ( & [ "rev-parse" , "--short" , head. as_str ( ) ] , Some ( repo_path) )
5696+ Self :: run_git ( & [ "rev-parse" , "--short=7 " , head. as_str ( ) ] , Some ( repo_path) )
56945697 . ok ( )
56955698 . map ( |value| value. trim ( ) . to_string ( ) )
56965699 . filter ( |value| !value. is_empty ( ) )
@@ -5707,7 +5710,7 @@ impl CliGitHandler {
57075710 . map ( |v| v. trim ( ) . to_string ( ) )
57085711 . filter ( |v| !v. is_empty ( ) ) ?;
57095712
5710- Self :: run_git ( & [ "rev-parse" , "--short" , head. as_str ( ) ] , Some ( repo_path) )
5713+ Self :: run_git ( & [ "rev-parse" , "--short=7 " , head. as_str ( ) ] , Some ( repo_path) )
57115714 . ok ( )
57125715 . map ( |v| v. trim ( ) . to_string ( ) )
57135716 . filter ( |v| !v. is_empty ( ) )
@@ -5722,7 +5725,7 @@ impl CliGitHandler {
57225725 }
57235726
57245727 let detached_head =
5725- Self :: run_git ( & [ "rev-parse" , "--short" , "HEAD" ] , Some ( repo_path) ) . ok ( ) ?;
5728+ Self :: run_git ( & [ "rev-parse" , "--short=7 " , "HEAD" ] , Some ( repo_path) ) . ok ( ) ?;
57265729 let trimmed_detached_head = detached_head. trim ( ) ;
57275730 if trimmed_detached_head. is_empty ( ) {
57285731 None
0 commit comments