Revert "receive-pack: use strict mode for unpacking objects"
This reverts commit 28f72a0f232dfc71b3be726e7e71d0a6d5f9ebba.
Junio C Hamano committed
Mar 4, 2008 at 03:11 UTC
9eb7a50b6ddb27250cf37a28c1d8181c33a733d3
2 files changed
+13
-29
Documentation/config.txt
-6
@@ -939,12 +939,6 @@ imap::
939
The configuration variables in the 'imap' section are described
940
in linkgit:git-imap-send[1].
941
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
-
942
receive.unpackLimit::
943
If the number of objects received in a push is below this
944
limit then the objects will be unpacked into loose object
receive-pack.c
+13
-23
@@ -10,7 +10,6 @@
10
static const char receive_pack_usage[] = "git-receive-pack <git-dir>";
11
12
static int deny_non_fast_forwards = 0;
13
-static int receive_fsck_objects = 1;
13
static int receive_unpack_limit = -1;
14
static int transfer_unpack_limit = -1;
15
static int unpack_limit = 100;
@@ -36,11 +35,6 @@ static int receive_pack_config(const char *var, const char *value)
35
return 0;
36
}
37
39
- if (strcmp(var, "receive.fsckobjects") == 0) {
40
- receive_fsck_objects = git_config_bool(var, value);
41
- return 0;
42
- }
43
-
38
return git_default_config(var, value);
39
}
40
@@ -374,13 +368,11 @@ static const char *unpack(void)
368
ntohl(hdr.hdr_version), ntohl(hdr.hdr_entries));
369
370
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;
376
code = run_command_v_opt(unpacker, RUN_GIT_CMD);
377
switch (code) {
378
case 0:
@@ -401,8 +393,8 @@ static const char *unpack(void)
393
return "unpacker exited with error code";
394
}
395
} else {
404
- const char *keeper[7];
405
- int s, status, i = 0;
396
+ const char *keeper[6];
397
+ int s, status;
398
char keep_arg[256];
399
struct child_process ip;
400
@@ -410,14 +402,12 @@ static const char *unpack(void)
402
if (gethostname(keep_arg + s, sizeof(keep_arg) - s))
403
strcpy(keep_arg + s, "localhost");
404
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;
411
memset(&ip, 0, sizeof(ip));
412
ip.argv = keeper;
413
ip.out = -1;