aboutsummaryrefslogtreecommitdiff
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-03-21 11:30:11 -0700
committerJunio C Hamano <gitster@pobox.com>2018-03-21 11:30:11 -0700
commitf62452ecfc99d914fe50f4e098c04e15cc1c7bae (patch)
tree0a443fe078ce386b924aee9cc5304b857678a88f /fetch-pack.c
parentfddf9a2d06719555fba8ce0cd09a695f012cca04 (diff)
parent98a2ea46c2dedf45b5a94335462547a5d78a68e2 (diff)
downloadgit-f62452ecfc99d914fe50f4e098c04e15cc1c7bae.tar.xz
Merge branch 'jt/transfer-fsck-with-promissor'
The transfer.fsckobjects configuration tells "git fetch" to validate the data and connected-ness of objects in the received pack; the code to perform this check has been taught about the narrow clone's convention that missing objects that are reachable from objects in a pack that came from a promissor remote is OK. * jt/transfer-fsck-with-promissor: fetch-pack: do not check links for partial fetch index-pack: support checking objects but not links
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index d97461296d..1d6117565c 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -886,8 +886,17 @@ static int get_pack(struct fetch_pack_args *args,
? fetch_fsck_objects
: transfer_fsck_objects >= 0
? transfer_fsck_objects
- : 0)
- argv_array_push(&cmd.args, "--strict");
+ : 0) {
+ if (args->from_promisor)
+ /*
+ * We cannot use --strict in index-pack because it
+ * checks both broken objects and links, but we only
+ * want to check for broken objects.
+ */
+ argv_array_push(&cmd.args, "--fsck-objects");
+ else
+ argv_array_push(&cmd.args, "--strict");
+ }
cmd.in = demux.out;
cmd.git_cmd = 1;