Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2019-06-25 16:40:38 +0300
committerJunio C Hamano <gitster@pobox.com>2019-06-26 00:05:38 +0300
commit60b7a92d846a6cc542f96fa0045735cc0b9265fd (patch)
tree04461bfe8a3e2339b25a717d8bdfd3204f43956a
parentdb27dca5cfe41ffa62f3a34cff2f7fafb2547307 (diff)
Move repository_format_partial_clone to promisor-remote.c
Now that we have has_promisor_remote() and can use many promisor remotes, let's hide repository_format_partial_clone 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>
-rw-r--r--cache.h1
-rw-r--r--environment.c1
-rw-r--r--promisor-remote.c7
-rw-r--r--promisor-remote.h6
-rw-r--r--setup.c3
5 files changed, 15 insertions, 3 deletions
diff --git a/cache.h b/cache.h
index bf20337ef4..e34b9e66d2 100644
--- 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 char *repository_format_partial_clone;
extern const char *core_partial_clone_filter_default;
extern int repository_format_worktree_config;
diff --git a/environment.c b/environment.c
index 89af47cb85..8855d2fc11 100644
--- a/environment.c
+++ b/environment.c
@@ -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;
-char *repository_format_partial_clone;
const char *core_partial_clone_filter_default;
int repository_format_worktree_config;
const char *git_commit_encoding;
diff --git a/promisor-remote.c b/promisor-remote.c
index 92c4c12c1c..31d51bb50e 100644
--- a/promisor-remote.c
+++ b/promisor-remote.c
@@ -4,6 +4,13 @@
#include "config.h"
#include "transport.h"
+static char *repository_format_partial_clone;
+
+void set_repository_format_partial_clone(char *partial_clone)
+{
+ repository_format_partial_clone = xstrdup_or_null(partial_clone);
+}
+
static int fetch_refs(const char *remote_name, struct ref *ref)
{
struct remote *remote;
diff --git a/promisor-remote.h b/promisor-remote.h
index 838cb092f3..8200dfc940 100644
--- a/promisor-remote.h
+++ b/promisor-remote.h
@@ -22,4 +22,10 @@ extern int promisor_remote_get_direct(struct repository *repo,
const struct object_id *oids,
int oid_nr);
+/*
+ * This should be used only once from setup.c to set the value we got
+ * from the extensions.partialclone config option.
+ */
+extern void set_repository_format_partial_clone(char *partial_clone);
+
#endif /* PROMISOR_REMOTE_H */
diff --git a/setup.c b/setup.c
index 8dcb4631f7..25a3038277 100644
--- a/setup.c
+++ b/setup.c
@@ -4,6 +4,7 @@
#include "dir.h"
#include "string-list.h"
#include "chdir-notify.h"
+#include "promisor-remote.h"
static int inside_git_dir = -1;
static int inside_work_tree = -1;
@@ -478,7 +479,7 @@ static int check_repository_format_gently(const char *gitdir, struct repository_
}
repository_format_precious_objects = candidate->precious_objects;
- repository_format_partial_clone = xstrdup_or_null(candidate->partial_clone);
+ set_repository_format_partial_clone(candidate->partial_clone);
repository_format_worktree_config = candidate->worktree_config;
string_list_clear(&candidate->unknown_extensions, 0);