extension.partialclone: introduce partial clone extension
[gitweb.git] / setup.c
diff --git a/setup.c b/setup.c
index d777ff34b7daf50fb24a8653a7e26e3e95b8c0c7..58536bd6eeb496d455953634b6b1943f69ed80ef 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -230,7 +230,7 @@ void verify_filename(const char *prefix,
                     int diagnose_misspelt_rev)
 {
        if (*arg == '-')
-               die("bad flag '%s' used after filename", arg);
+               die("option '%s' must come before non-option arguments", arg);
        if (looks_like_pathspec(arg) || check_filename(prefix, arg))
                return;
        die_verify_filename(prefix, arg, diagnose_misspelt_rev);
@@ -420,7 +420,11 @@ static int check_repo_format(const char *var, const char *value, void *vdata)
                        ;
                else if (!strcmp(ext, "preciousobjects"))
                        data->precious_objects = git_config_bool(var, value);
-               else
+               else if (!strcmp(ext, "partialclone")) {
+                       if (!value)
+                               return config_error_nonbool(var);
+                       data->partial_clone = xstrdup(value);
+               } else
                        string_list_append(&data->unknown_extensions, ext);
        } else if (strcmp(var, "core.bare") == 0) {
                data->is_bare = git_config_bool(var, value);
@@ -463,6 +467,7 @@ static int check_repository_format_gently(const char *gitdir, int *nongit_ok)
        }
 
        repository_format_precious_objects = candidate.precious_objects;
+       repository_format_partial_clone = candidate.partial_clone;
        string_list_clear(&candidate.unknown_extensions, 0);
        if (!has_common) {
                if (candidate.is_bare != -1) {