Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-01-25 12:03:18 +0300
committerJunio C Hamano <junkio@cox.net>2006-01-28 11:09:38 +0300
commit46a6c2620ba421397eec627b8eb18eb530e694fc (patch)
tree9222e809b0d77ad10e7304073d4c053c7edd9266 /sha1_name.c
parent6b94f1e404afc552e5139c4357331843f5be61ad (diff)
abbrev cleanup: use symbolic constants
The minimum length of abbreviated object name was hardcoded in different places to be 4, risking inconsistencies in the future. Also there were three different "default abbreviation precision". Use two C preprocessor symbols to clean up this mess. 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 e18a96d772..ba0747c84d 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -155,7 +155,7 @@ static int get_short_sha1(const char *name, int len, unsigned char *sha1,
char canonical[40];
unsigned char res[20];
- if (len < 4)
+ if (len < MINIMUM_ABBREV)
return -1;
memset(res, 0, 20);
memset(canonical, 'x', 40);