diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-10-05 12:36:20 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-05 12:36:20 -0700 |
commit | ca0c9764bfe4f5d33551b5cca74eb0966f796baf (patch) | |
tree | ee63c84f0226d0443536ca9e00935b3c9877bb32 /builtin/fetch-pack.c | |
parent | f817f2fbb5e3dbe49be446438838a11b192c2715 (diff) | |
parent | b10a53583f5725b796de630c946e41bbd48fcfe2 (diff) | |
download | git-ca0c9764bfe4f5d33551b5cca74eb0966f796baf.tar.gz |
Merge branch 'jc/fetch-pack-fsck-objects'
* jc/fetch-pack-fsck-objects:
test: fetch/receive with fsckobjects
transfer.fsckobjects: unify fetch/receive.fsckobjects
fetch.fsckobjects: verify downloaded objects
Conflicts:
Documentation/config.txt
builtin/fetch-pack.c
Diffstat (limited to 'builtin/fetch-pack.c')
-rw-r--r-- | builtin/fetch-pack.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index 412bd327b5..c8bf9b85b0 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@ -15,7 +15,9 @@ 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 no_done = 0; +static int no_done; +static int fetch_fsck_objects = -1; +static int transfer_fsck_objects = -1; static struct fetch_pack_args args = { /* .uploadpack = */ "git-upload-pack", }; @@ -734,6 +736,12 @@ static int get_pack(int xd[2], char **pack_lockfile) } if (*hdr_arg) *av++ = hdr_arg; + if (fetch_fsck_objects >= 0 + ? fetch_fsck_objects + : transfer_fsck_objects >= 0 + ? transfer_fsck_objects + : 0) + *av++ = "--strict"; *av++ = NULL; cmd.in = demux.out; @@ -853,6 +861,16 @@ static int fetch_pack_config(const char *var, const char *value, void *cb) return 0; } + if (!strcmp(var, "fetch.fsckobjects")) { + fetch_fsck_objects = git_config_bool(var, value); + return 0; + } + + if (!strcmp(var, "transfer.fsckobjects")) { + transfer_fsck_objects = git_config_bool(var, value); + return 0; + } + return git_default_config(var, value, cb); } |