summaryrefslogtreecommitdiff
path: root/builtin/fetch-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-09-04 19:26:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-09-04 19:27:17 (GMT)
commit5e838ea7aa74dfbc9820bcf798c0f118e91532f9 (patch)
tree1a0417208bc9161ab0df0072107664e067b8a0ec /builtin/fetch-pack.c
parent81b50f3ce40bfdd66e5d967bf82be001039a9a98 (diff)
downloadgit-5e838ea7aa74dfbc9820bcf798c0f118e91532f9.zip
git-5e838ea7aa74dfbc9820bcf798c0f118e91532f9.tar.gz
git-5e838ea7aa74dfbc9820bcf798c0f118e91532f9.tar.bz2
fetch.fsckobjects: verify downloaded objects
This corresponds to receive.fsckobjects configuration variable added (a lot) earlier in 20dc001 (receive-pack: allow using --strict mode for unpacking objects, 2008-02-25). Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fetch-pack.c')
-rw-r--r--builtin/fetch-pack.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index dbd8b7b..df6a8dc 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -14,6 +14,7 @@ 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 struct fetch_pack_args args = {
/* .uploadpack = */ "git-upload-pack",
};
@@ -663,6 +664,8 @@ static int get_pack(int xd[2], char **pack_lockfile)
}
if (*hdr_arg)
*av++ = hdr_arg;
+ if (fetch_fsck_objects)
+ *av++ = "--strict";
*av++ = NULL;
cmd.in = demux.out;
@@ -776,6 +779,11 @@ 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;
+ }
+
return git_default_config(var, value, cb);
}