annotate: Correct most merge following to annotate correctly.
[gitweb.git] / config.c
index 3e077d4c6ca4f7162e3a3254e1b3e90db33270ff..b23f4bf487f5f4350f46e13c590db6f7ea1f5917 100644 (file)
--- a/config.c
+++ b/config.c
@@ -279,18 +279,28 @@ int git_default_config(const char *var, const char *value)
                return 0;
        }
 
+       if (!strcmp(var, "core.compression")) {
+               int level = git_config_int(var, value);
+               if (level == -1)
+                       level = Z_DEFAULT_COMPRESSION;
+               else if (level < 0 || level > Z_BEST_COMPRESSION)
+                       die("bad zlib compression level %d", level);
+               zlib_compression_level = level;
+               return 0;
+       }
+
        if (!strcmp(var, "user.name")) {
-               safe_strncpy(git_default_name, value, sizeof(git_default_name));
+               strlcpy(git_default_name, value, sizeof(git_default_name));
                return 0;
        }
 
        if (!strcmp(var, "user.email")) {
-               safe_strncpy(git_default_email, value, sizeof(git_default_email));
+               strlcpy(git_default_email, value, sizeof(git_default_email));
                return 0;
        }
 
        if (!strcmp(var, "i18n.commitencoding")) {
-               safe_strncpy(git_commit_encoding, value, sizeof(git_commit_encoding));
+               strlcpy(git_commit_encoding, value, sizeof(git_commit_encoding));
                return 0;
        }