@matheusbsbs / matheus-bagliano / commits / 02c5cba200
Fork 0

find_unique_abbrev() with len=0 should not abbreviate

Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Aug 9, 2006 at 13:17 UTC 02c5cba2007856465710aa37cd41b404372ab95b
1 file changed +1 -1
sha1_name.c
+1 -1
@@ -193,7 +193,7 @@ const char *find_unique_abbrev(const unsigned char *sha1, int len)
193
194 is_null = !memcmp(sha1, null_sha1, 20);
195 memcpy(hex, sha1_to_hex(sha1), 40);
196 - if (len == 40)
196 + if (len == 40 || !len)
197 return hex;
198 while (len < 40) {
199 unsigned char sha1_ret[20];