Skip to content

Commit

Permalink
find_unique_abbrev() with len=0 should not abbreviate
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Aug 9, 2006
1 parent 72ee96c commit 02c5cba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sha1_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ const char *find_unique_abbrev(const unsigned char *sha1, int len)

is_null = !memcmp(sha1, null_sha1, 20);
memcpy(hex, sha1_to_hex(sha1), 40);
if (len == 40)
if (len == 40 || !len)
return hex;
while (len < 40) {
unsigned char sha1_ret[20];
Expand Down

0 comments on commit 02c5cba

Please sign in to comment.