Skip to content

Commit d6e1466

Browse files
kjbracey2gitster
authored andcommitted
checkout: abbreviate hash in suggest_reattach
After printing the list of left-behind commits (with abbreviated hashes), use an abbreviated hash in the suggested 'git branch' command; there's no point in outputting a full 40-character hex string in some friendly advice. Signed-off-by: Kevin Bracey <[email protected]> Acked-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 52a3e01 commit d6e1466

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/checkout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ static void suggest_reattach(struct commit *commit, struct rev_info *revs)
729729
"If you want to keep them by creating a new branch, "
730730
"this may be a good time\nto do so with:\n\n"
731731
" git branch new_branch_name %s\n\n"),
732-
sha1_to_hex(commit->object.sha1));
732+
find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV));
733733
}
734734

735735
/*

0 commit comments

Comments
 (0)