aboutsummaryrefslogtreecommitdiff
path: root/builtin/receive-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-10-05 12:36:20 -0700
committerJunio C Hamano <gitster@pobox.com>2011-10-05 12:36:20 -0700
commitca0c9764bfe4f5d33551b5cca74eb0966f796baf (patch)
treeee63c84f0226d0443536ca9e00935b3c9877bb32 /builtin/receive-pack.c
parentf817f2fbb5e3dbe49be446438838a11b192c2715 (diff)
parentb10a53583f5725b796de630c946e41bbd48fcfe2 (diff)
downloadgit-ca0c9764bfe4f5d33551b5cca74eb0966f796baf.tar.gz
git-ca0c9764bfe4f5d33551b5cca74eb0966f796baf.tar.xz
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/receive-pack.c')
-rw-r--r--builtin/receive-pack.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index ae164da4d..4cc03065b 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -25,7 +25,8 @@ static int deny_deletes;
static int deny_non_fast_forwards;
static enum deny_action deny_current_branch = DENY_UNCONFIGURED;
static enum deny_action deny_delete_current = DENY_UNCONFIGURED;
-static int receive_fsck_objects;
+static int receive_fsck_objects = -1;
+static int transfer_fsck_objects = -1;
static int receive_unpack_limit = -1;
static int transfer_unpack_limit = -1;
static int unpack_limit = 100;
@@ -79,6 +80,11 @@ static int receive_pack_config(const char *var, const char *value, void *cb)
return 0;
}
+ if (strcmp(var, "transfer.fsckobjects") == 0) {
+ transfer_fsck_objects = git_config_bool(var, value);
+ return 0;
+ }
+
if (!strcmp(var, "receive.denycurrentbranch")) {
deny_current_branch = parse_deny_action(var, value);
return 0;
@@ -674,6 +680,11 @@ static const char *unpack(void)
struct pack_header hdr;
const char *hdr_err;
char hdr_arg[38];
+ int fsck_objects = (receive_fsck_objects >= 0
+ ? receive_fsck_objects
+ : transfer_fsck_objects >= 0
+ ? transfer_fsck_objects
+ : 0);
hdr_err = parse_pack_header(&hdr);
if (hdr_err)
@@ -686,7 +697,7 @@ static const char *unpack(void)
int code, i = 0;
const char *unpacker[4];
unpacker[i++] = "unpack-objects";
- if (receive_fsck_objects)
+ if (fsck_objects)
unpacker[i++] = "--strict";
unpacker[i++] = hdr_arg;
unpacker[i++] = NULL;
@@ -706,7 +717,7 @@ static const char *unpack(void)
keeper[i++] = "index-pack";
keeper[i++] = "--stdin";
- if (receive_fsck_objects)
+ if (fsck_objects)
keeper[i++] = "--strict";
keeper[i++] = "--fix-thin";
keeper[i++] = hdr_arg;