THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Browse Source

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>
tags/v2.24.0-rc0
Christian Couder Junio C Hamano 3 months ago
parent
commit
60b7a92d84
5 changed files with 15 additions and 3 deletions
  1. 0
    1
      cache.h
  2. 0
    1
      environment.c
  3. 7
    0
      promisor-remote.c
  4. 6
    0
      promisor-remote.h
  5. 2
    1
      setup.c

+ 0
- 1
cache.h View File

@@ -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;


+ 0
- 1
environment.c View 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;
char *repository_format_partial_clone;
const char *core_partial_clone_filter_default;
int repository_format_worktree_config;
const char *git_commit_encoding;

+ 7
- 0
promisor-remote.c View File

@@ -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;

+ 6
- 0
promisor-remote.h View File

@@ -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 */

+ 2
- 1
setup.c View File

@@ -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);


Loading…
Cancel
Save