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>
This commit is contained in:
Junio C Hamano
2011-09-04 12:37:45 -07:00
parent 5e838ea7aa
commit dab76d3aa6
3 changed files with 35 additions and 7 deletions

View File

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