From: Junio C Hamano Date: Wed, 9 Aug 2006 20:17:04 +0000 (-0700) Subject: find_unique_abbrev() with len=0 should not abbreviate X-Git-Tag: v1.4.2-rc4~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=02c5cba2007856465710aa37cd41b404372ab95b;p=git.git find_unique_abbrev() with len=0 should not abbreviate Signed-off-by: Junio C Hamano --- diff --git a/sha1_name.c b/sha1_name.c index 5fe8e5d4b..c5a05faeb 100644 --- a/sha1_name.c +++ b/sha1_name.c @@ -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];