summaryrefslogtreecommitdiff
path: root/builtin/fetch-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-10-05 19:36:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-10-05 19:36:20 (GMT)
commitca0c9764bfe4f5d33551b5cca74eb0966f796baf (patch)
treeee63c84f0226d0443536ca9e00935b3c9877bb32 /builtin/fetch-pack.c
parentf817f2fbb5e3dbe49be446438838a11b192c2715 (diff)
parentb10a53583f5725b796de630c946e41bbd48fcfe2 (diff)
downloadgit-ca0c9764bfe4f5d33551b5cca74eb0966f796baf.zip
git-ca0c9764bfe4f5d33551b5cca74eb0966f796baf.tar.gz
git-ca0c9764bfe4f5d33551b5cca74eb0966f796baf.tar.bz2
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.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index 412bd32..c8bf9b8 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);
}