From 02c5cba2007856465710aa37cd41b404372ab95b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 9 Aug 2006 13:17:04 -0700 Subject: [PATCH] find_unique_abbrev() with len=0 should not abbreviate Signed-off-by: Junio C Hamano --- sha1_name.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]; -- 2.26.2