diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-09-04 23:37:45 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-09-04 23:39:32 +0400 |
commit | dab76d3aa682a340e886df84da33326368c38633 (patch) | |
tree | 411ed9ca9713a519d7c8a6fd4ce0a7bb5b87b3b7 /builtin/fetch-pack.c | |
parent | 5e838ea7aa74dfbc9820bcf798c0f118e91532f9 (diff) |
transfer.fsckobjects: unify fetch/receive.fsckobjects
This single variable can be used to set instead of setting fsckobjects
variable for fetch & receive independently.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fetch-pack.c')
-rw-r--r-- | builtin/fetch-pack.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index df6a8dc277..dac3038e90 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@ -14,7 +14,8 @@ static int transfer_unpack_limit = -1; static int fetch_unpack_limit = -1; static int unpack_limit = 100; static int prefer_ofs_delta = 1; -static int fetch_fsck_objects; +static int fetch_fsck_objects = -1; +static int transfer_fsck_objects = -1; static struct fetch_pack_args args = { /* .uploadpack = */ "git-upload-pack", }; @@ -664,7 +665,11 @@ static int get_pack(int xd[2], char **pack_lockfile) } if (*hdr_arg) *av++ = hdr_arg; - if (fetch_fsck_objects) + if (fetch_fsck_objects >= 0 + ? fetch_fsck_objects + : transfer_fsck_objects >= 0 + ? transfer_fsck_objects + : 0) *av++ = "--strict"; *av++ = NULL; @@ -784,6 +789,11 @@ static int fetch_pack_config(const char *var, const char *value, void *cb) return 0; } + if (!strcmp(var, "transfer.fsckobjects")) { + transfer_fsck_objects = git_config_bool(var, value); + return 0; + } + return git_default_config(var, value, cb); } |