]> git.ipfire.org Git - thirdparty/git.git/blobdiff - config.c
Make the default abbrev length configurable
[thirdparty/git.git] / config.c
index 625e0518767712583f917762634c2fc852c4d2eb..e8a6e56795e3d1e72cab9bb522bd03bdcdb5bdca 100644 (file)
--- a/config.c
+++ b/config.c
@@ -531,6 +531,14 @@ static int git_default_core_config(const char *var, const char *value)
                return 0;
        }
 
+       if (!strcmp(var, "core.abbrevlength")) {
+               int abbrev = git_config_int(var, value);
+               if (abbrev < minimum_abbrev || abbrev > 40)
+                       return -1;
+               default_abbrev = abbrev;
+               return 0;
+       }
+
        if (!strcmp(var, "core.loosecompression")) {
                int level = git_config_int(var, value);
                if (level == -1)