aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-10-28 14:39:13 -0700
committerJunio C Hamano <gitster@pobox.com>2010-10-28 17:37:35 -0700
commit72a5b561fc1c4286bc7c5b0693afc076af261e1f (patch)
tree0dd2d883abce19c72834be8a5a6c52526f392713 /config.c
parent7ebee44167fc25b975f5543472c851ab1840af1b (diff)
downloadgit-72a5b561fc1c4286bc7c5b0693afc076af261e1f.tar.gz
git-72a5b561fc1c4286bc7c5b0693afc076af261e1f.tar.xz
core.abbrevguard: Ensure short object names stay unique a bit longer
Even though git makes sure that it uses enough hexdigits to show an abbreviated object name unambiguously, as more objects are added to the repository over time, a short name that used to be unique will stop being unique. Git uses this many extra hexdigits that are more than necessary to make the object name currently unique, in the hope that its output will stay unique a bit longer. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r--config.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/config.c b/config.c
index 4b0a82040..1aa72c2c4 100644
--- a/config.c
+++ b/config.c
@@ -489,6 +489,13 @@ static int git_default_core_config(const char *var, const char *value)
return 0;
}
+ if (!strcmp(var, "core.abbrevguard")) {
+ unique_abbrev_extra_length = git_config_int(var, value);
+ if (unique_abbrev_extra_length < 0)
+ unique_abbrev_extra_length = 0;
+ return 0;
+ }
+
if (!strcmp(var, "core.bare")) {
is_bare_repository_cfg = git_config_bool(var, value);
return 0;