summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-09-09 14:27:11 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-09-09 14:27:11 -0700
commita5e10f8bc1db418fc806abb7574bb1e468948d19 (patch)
tree7b16be6b855c74eaa6534fa758f41d784ba2b846 /remote.c
parentremote-bzr: reuse bzrlib transports when possible (diff)
parentfetch: make --prune configurable (diff)
downloadtgif-a5e10f8bc1db418fc806abb7574bb1e468948d19.tar.xz
Merge branch 'ms/fetch-prune-configuration'
Allow fetch.prune and remote.*.prune configuration variables to be set, and "git fetch" to behave as if "--prune" is given. "git fetch" that honors remote.*.prune is fine, but I wonder if we should somehow make "git push" aware of it as well. Perhaps remote.*.prune should not be just a boolean, but a 4-way "none", "push", "fetch", "both"? * ms/fetch-prune-configuration: fetch: make --prune configurable
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/remote.c b/remote.c
index efcba931ec..8f0f2dd10e 100644
--- a/remote.c
+++ b/remote.c
@@ -148,6 +148,7 @@ static struct remote *make_remote(const char *name, int len)
}
ret = xcalloc(1, sizeof(struct remote));
+ ret->prune = -1; /* unspecified */
ALLOC_GROW(remotes, remotes_nr + 1, remotes_alloc);
remotes[remotes_nr++] = ret;
if (len)
@@ -404,6 +405,8 @@ static int handle_config(const char *key, const char *value, void *cb)
remote->skip_default_update = git_config_bool(key, value);
else if (!strcmp(subkey, ".skipfetchall"))
remote->skip_default_update = git_config_bool(key, value);
+ else if (!strcmp(subkey, ".prune"))
+ remote->prune = git_config_bool(key, value);
else if (!strcmp(subkey, ".url")) {
const char *v;
if (git_config_string(&v, key, value))