Skip to content

Commit 60b7a92

Browse files
chriscoolgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent db27dca commit 60b7a92

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

cache.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,6 @@ extern int grafts_replace_parents;
961961
#define GIT_REPO_VERSION 0
962962
#define GIT_REPO_VERSION_READ 1
963963
extern int repository_format_precious_objects;
964-
extern char *repository_format_partial_clone;
965964
extern const char *core_partial_clone_filter_default;
966965
extern int repository_format_worktree_config;
967966

environment.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ int warn_ambiguous_refs = 1;
3131
int warn_on_object_refname_ambiguity = 1;
3232
int ref_paranoia = -1;
3333
int repository_format_precious_objects;
34-
char *repository_format_partial_clone;
3534
const char *core_partial_clone_filter_default;
3635
int repository_format_worktree_config;
3736
const char *git_commit_encoding;

promisor-remote.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
#include "config.h"
55
#include "transport.h"
66

7+
static char *repository_format_partial_clone;
8+
9+
void set_repository_format_partial_clone(char *partial_clone)
10+
{
11+
repository_format_partial_clone = xstrdup_or_null(partial_clone);
12+
}
13+
714
static int fetch_refs(const char *remote_name, struct ref *ref)
815
{
916
struct remote *remote;

promisor-remote.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,10 @@ extern int promisor_remote_get_direct(struct repository *repo,
2222
const struct object_id *oids,
2323
int oid_nr);
2424

25+
/*
26+
* This should be used only once from setup.c to set the value we got
27+
* from the extensions.partialclone config option.
28+
*/
29+
extern void set_repository_format_partial_clone(char *partial_clone);
30+
2531
#endif /* PROMISOR_REMOTE_H */

setup.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "dir.h"
55
#include "string-list.h"
66
#include "chdir-notify.h"
7+
#include "promisor-remote.h"
78

89
static int inside_git_dir = -1;
910
static int inside_work_tree = -1;
@@ -478,7 +479,7 @@ static int check_repository_format_gently(const char *gitdir, struct repository_
478479
}
479480

480481
repository_format_precious_objects = candidate->precious_objects;
481-
repository_format_partial_clone = xstrdup_or_null(candidate->partial_clone);
482+
set_repository_format_partial_clone(candidate->partial_clone);
482483
repository_format_worktree_config = candidate->worktree_config;
483484
string_list_clear(&candidate->unknown_extensions, 0);
484485

0 commit comments

Comments
 (0)