aboutsummaryrefslogtreecommitdiff
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-01-24 17:02:15 -0800
committerJunio C Hamano <junkio@cox.net>2007-01-24 18:08:02 -0800
commite28714c527339a477fca226765163b9361d94285 (patch)
tree73a590d0c86774ecb64fc93af67c630ad75d6f4d /fetch-pack.c
parentaf7cf268f0bf8d4216f9c11d1cb0082cb3550f61 (diff)
downloadgit-e28714c527339a477fca226765163b9361d94285.tar.gz
git-e28714c527339a477fca226765163b9361d94285.tar.xz
Consolidate {receive,fetch}.unpackLimit
This allows transfer.unpackLimit to specify what these two configuration variables want to set. We would probably want to deprecate the two separate variables, as I do not see much point in specifying them independently. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index fc0534ce0..83a1d7b31 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -8,6 +8,8 @@
#include "sideband.h"
static int keep_pack;
+static int transfer_unpack_limit = -1;
+static int fetch_unpack_limit = -1;
static int unpack_limit = 100;
static int quiet;
static int verbose;
@@ -645,7 +647,12 @@ static int remove_duplicates(int nr_heads, char **heads)
static int fetch_pack_config(const char *var, const char *value)
{
if (strcmp(var, "fetch.unpacklimit") == 0) {
- unpack_limit = git_config_int(var, value);
+ fetch_unpack_limit = git_config_int(var, value);
+ return 0;
+ }
+
+ if (strcmp(var, "transfer.unpacklimit") == 0) {
+ transfer_unpack_limit = git_config_int(var, value);
return 0;
}
@@ -666,6 +673,11 @@ int main(int argc, char **argv)
setup_ident();
git_config(fetch_pack_config);
+ if (0 <= transfer_unpack_limit)
+ unpack_limit = transfer_unpack_limit;
+ else if (0 <= fetch_unpack_limit)
+ unpack_limit = fetch_unpack_limit;
+
nr_heads = 0;
heads = NULL;
for (i = 1; i < argc; i++) {