@matheusbsbs / matheus-bagliano / commits / 3b67d2917a
Fork 0

unpack-objects -r: call it "recover".

The code called this operation "desperate" but the option flag is -r and the word "recover" describes what it does better. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Sep 13, 2006 at 12:59 UTC 3b67d2917a0e93aa583c4069f5a00655e05dbd84
2 files changed +7 -7
Documentation/git-unpack-objects.txt
+1 -1
@@ -37,7 +37,7 @@ OPTIONS
37 -r::
38 When unpacking a corrupt packfile, the command dies at
39 the first corruption. This flag tells it to keep going
40 - and make the best effort to salvage as many objects as
40 + and make the best effort to recover as many objects as
41 possible.
42
43
builtin-unpack-objects.c
+6 -6
@@ -10,8 +10,8 @@
10
11 #include <sys/time.h>
12
13 -static int dry_run, quiet, desperate, has_errors;
14 -static const char unpack_usage[] = "git-unpack-objects [-n] [-q] < pack-file";
13 +static int dry_run, quiet, recover, has_errors;
14 +static const char unpack_usage[] = "git-unpack-objects [-n] [-q] [-r] < pack-file";
15
16 /* We always read in 4kB chunks. */
17 static unsigned char buffer[4096];
@@ -75,7 +75,7 @@ static void *get_data(unsigned long size)
75 error("inflate returned %d\n", ret);
76 free(buf);
77 buf = NULL;
78 - if (!desperate)
78 + if (!recover)
79 exit(1);
80 has_errors = 1;
81 break;
@@ -192,7 +192,7 @@ static void unpack_delta_entry(unsigned long delta_size)
192 if (!base) {
193 error("failed to read delta-pack base object %s",
194 sha1_to_hex(base_sha1));
195 - if (!desperate)
195 + if (!recover)
196 exit(1);
197 has_errors = 1;
198 return;
@@ -247,7 +247,7 @@ static void unpack_one(unsigned nr, unsigned total)
247 default:
248 error("bad object type %d", type);
249 has_errors = 1;
250 - if (desperate)
250 + if (recover)
251 return;
252 exit(1);
253 }
@@ -294,7 +294,7 @@ int cmd_unpack_objects(int argc, const char **argv, const char *prefix)
294 continue;
295 }
296 if (!strcmp(arg, "-r")) {
297 - desperate = 1;
297 + recover = 1;
298 continue;
299 }
300 usage(unpack_usage);