Skip to content

Commit 9eb7a50

Browse files
committed
Revert "receive-pack: use strict mode for unpacking objects"
This reverts commit 28f72a0.
1 parent 27b4070 commit 9eb7a50

File tree

2 files changed

+13
-29
lines changed

2 files changed

+13
-29
lines changed

Documentation/config.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -939,12 +939,6 @@ imap::
939939
The configuration variables in the 'imap' section are described
940940
in linkgit:git-imap-send[1].
941941

942-
receive.fsckObjects::
943-
If it is set to true, git-receive-pack will check all received
944-
objects. It will abort in the case of a malformed object or a
945-
broken link. The result of an abort are only dangling objects.
946-
The default value is true.
947-
948942
receive.unpackLimit::
949943
If the number of objects received in a push is below this
950944
limit then the objects will be unpacked into loose object

receive-pack.c

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
static const char receive_pack_usage[] = "git-receive-pack <git-dir>";
1111

1212
static int deny_non_fast_forwards = 0;
13-
static int receive_fsck_objects = 1;
1413
static int receive_unpack_limit = -1;
1514
static int transfer_unpack_limit = -1;
1615
static int unpack_limit = 100;
@@ -36,11 +35,6 @@ static int receive_pack_config(const char *var, const char *value)
3635
return 0;
3736
}
3837

39-
if (strcmp(var, "receive.fsckobjects") == 0) {
40-
receive_fsck_objects = git_config_bool(var, value);
41-
return 0;
42-
}
43-
4438
return git_default_config(var, value);
4539
}
4640

@@ -374,13 +368,11 @@ static const char *unpack(void)
374368
ntohl(hdr.hdr_version), ntohl(hdr.hdr_entries));
375369

376370
if (ntohl(hdr.hdr_entries) < unpack_limit) {
377-
int code, i = 0;
378-
const char *unpacker[4];
379-
unpacker[i++] = "unpack-objects";
380-
if (receive_fsck_objects)
381-
unpacker[i++] = "--strict";
382-
unpacker[i++] = hdr_arg;
383-
unpacker[i++] = NULL;
371+
int code;
372+
const char *unpacker[3];
373+
unpacker[0] = "unpack-objects";
374+
unpacker[1] = hdr_arg;
375+
unpacker[2] = NULL;
384376
code = run_command_v_opt(unpacker, RUN_GIT_CMD);
385377
switch (code) {
386378
case 0:
@@ -401,23 +393,21 @@ static const char *unpack(void)
401393
return "unpacker exited with error code";
402394
}
403395
} else {
404-
const char *keeper[7];
405-
int s, status, i = 0;
396+
const char *keeper[6];
397+
int s, status;
406398
char keep_arg[256];
407399
struct child_process ip;
408400

409401
s = sprintf(keep_arg, "--keep=receive-pack %i on ", getpid());
410402
if (gethostname(keep_arg + s, sizeof(keep_arg) - s))
411403
strcpy(keep_arg + s, "localhost");
412404

413-
keeper[i++] = "index-pack";
414-
keeper[i++] = "--stdin";
415-
if (receive_fsck_objects)
416-
keeper[i++] = "--strict";
417-
keeper[i++] = "--fix-thin";
418-
keeper[i++] = hdr_arg;
419-
keeper[i++] = keep_arg;
420-
keeper[i++] = NULL;
405+
keeper[0] = "index-pack";
406+
keeper[1] = "--stdin";
407+
keeper[2] = "--fix-thin";
408+
keeper[3] = hdr_arg;
409+
keeper[4] = keep_arg;
410+
keeper[5] = NULL;
421411
memset(&ip, 0, sizeof(ip));
422412
ip.argv = keeper;
423413
ip.out = -1;

0 commit comments

Comments
 (0)