Move core_partial_clone_filter_default to promisor-remote.c
authorChristian Couder <christian.couder@gmail.com>
Tue, 25 Jun 2019 13:40:39 +0000 (15:40 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 25 Jun 2019 21:05:38 +0000 (14:05 -0700)
Now that we can have a different default partial clone filter for
each promisor remote, let's hide core_partial_clone_filter_default
as a static in promisor-remote.c to avoid it being use for
anything other than managing backward compatibility.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
config.c
environment.c
promisor-remote.c
diff --git a/cache.h b/cache.h
index e34b9e66d2a57d64b6b4ef55ced7fa729ffa235b..a4d7f84eebcab27e6f0108fccb2b2de81050fec0 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -961,7 +961,6 @@ extern int grafts_replace_parents;
 #define GIT_REPO_VERSION 0
 #define GIT_REPO_VERSION_READ 1
 extern int repository_format_precious_objects;
-extern const char *core_partial_clone_filter_default;
 extern int repository_format_worktree_config;
 
 /*
index 296a6d9cc4110bd7fcef542ac9cc9cfe04d4f4d4..317b226bc88845780b637cdf82557a8763aaea8d 100644 (file)
--- a/config.c
+++ b/config.c
@@ -1344,11 +1344,6 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
                return 0;
        }
 
-       if (!strcmp(var, "core.partialclonefilter")) {
-               return git_config_string(&core_partial_clone_filter_default,
-                                        var, value);
-       }
-
        if (!strcmp(var, "core.usereplacerefs")) {
                read_replace_refs = git_config_bool(var, value);
                return 0;
index 8855d2fc1101b5106279ba16900e3f5eebe35515..efa072680a2bca0d317b66554a325b73c227c866 100644 (file)
@@ -31,7 +31,6 @@ int warn_ambiguous_refs = 1;
 int warn_on_object_refname_ambiguity = 1;
 int ref_paranoia = -1;
 int repository_format_precious_objects;
-const char *core_partial_clone_filter_default;
 int repository_format_worktree_config;
 const char *git_commit_encoding;
 const char *git_log_output_encoding;
index 31d51bb50e0aea32a5898e0876f660600fd1eb90..9bc296cdde2acc3871c0738533decb70c69f1b62 100644 (file)
@@ -5,6 +5,7 @@
 #include "transport.h"
 
 static char *repository_format_partial_clone;
+static const char *core_partial_clone_filter_default;
 
 void set_repository_format_partial_clone(char *partial_clone)
 {
@@ -103,6 +104,10 @@ static int promisor_remote_config(const char *var, const char *value, void *data
        int namelen;
        const char *subkey;
 
+       if (!strcmp(var, "core.partialclonefilter"))
+               return git_config_string(&core_partial_clone_filter_default,
+                                        var, value);
+
        if (parse_config_key(var, "remote", &name, &namelen, &subkey) < 0)
                return 0;