Skip to content

Commit

Permalink
unpack-objects -r: call it "recover".
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Sep 13, 2006
1 parent f986f2c commit 3b67d29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Documentation/git-unpack-objects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ OPTIONS
-r::
When unpacking a corrupt packfile, the command dies at
the first corruption. This flag tells it to keep going
and make the best effort to salvage as many objects as
and make the best effort to recover as many objects as
possible.


Expand Down
12 changes: 6 additions & 6 deletions builtin-unpack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

#include <sys/time.h>

static int dry_run, quiet, desperate, has_errors;
static const char unpack_usage[] = "git-unpack-objects [-n] [-q] < pack-file";
static int dry_run, quiet, recover, has_errors;
static const char unpack_usage[] = "git-unpack-objects [-n] [-q] [-r] < pack-file";

/* We always read in 4kB chunks. */
static unsigned char buffer[4096];
Expand Down Expand Up @@ -75,7 +75,7 @@ static void *get_data(unsigned long size)
error("inflate returned %d\n", ret);
free(buf);
buf = NULL;
if (!desperate)
if (!recover)
exit(1);
has_errors = 1;
break;
Expand Down Expand Up @@ -192,7 +192,7 @@ static void unpack_delta_entry(unsigned long delta_size)
if (!base) {
error("failed to read delta-pack base object %s",
sha1_to_hex(base_sha1));
if (!desperate)
if (!recover)
exit(1);
has_errors = 1;
return;
Expand Down Expand Up @@ -247,7 +247,7 @@ static void unpack_one(unsigned nr, unsigned total)
default:
error("bad object type %d", type);
has_errors = 1;
if (desperate)
if (recover)
return;
exit(1);
}
Expand Down Expand Up @@ -294,7 +294,7 @@ int cmd_unpack_objects(int argc, const char **argv, const char *prefix)
continue;
}
if (!strcmp(arg, "-r")) {
desperate = 1;
recover = 1;
continue;
}
usage(unpack_usage);
Expand Down

0 comments on commit 3b67d29

Please sign in to comment.