aboutsummaryrefslogtreecommitdiff
path: root/sha1_name.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-08-09 13:17:04 -0700
committerJunio C Hamano <junkio@cox.net>2006-08-09 13:17:04 -0700
commit02c5cba2007856465710aa37cd41b404372ab95b (patch)
tree72c1e598e3f730d2e2778183552262b1fe1d7758 /sha1_name.c
parent72ee96c0f1861fcdb9eaf39e78d86888437a27a9 (diff)
downloadgit-02c5cba2007856465710aa37cd41b404372ab95b.tar.gz
git-02c5cba2007856465710aa37cd41b404372ab95b.tar.xz
find_unique_abbrev() with len=0 should not abbreviate
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'sha1_name.c')
-rw-r--r--sha1_name.c2
1 files changed, 1 insertions, 1 deletions
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];