Skip to content

Commit

Permalink
fsck-cache: show root objects only with "--root"
Browse files Browse the repository at this point in the history
This makes the default fsck behaviour be quiet for a repository
that doesn't have any problems. Which is good.
  • Loading branch information
Linus Torvalds committed Apr 25, 2005
1 parent 889262e commit ab7df18
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fsck-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#define REACHABLE 0x0001

static int show_root = 0;
static int show_tags = 0;
static int show_unreachable = 0;
static unsigned char head_sha1[20];
Expand Down Expand Up @@ -56,7 +57,7 @@ static int fsck_commit(unsigned char *sha1, void *data, unsigned long size)
return -1;
if (!commit->tree)
return -1;
if (!commit->parents)
if (!commit->parents && show_root)
printf("root %s\n", sha1_to_hex(sha1));
if (!commit->date)
printf("bad commit date in %s\n", sha1_to_hex(sha1));
Expand Down Expand Up @@ -203,6 +204,10 @@ int main(int argc, char **argv)
show_tags = 1;
continue;
}
if (!strcmp(arg, "--root")) {
show_root = 1;
continue;
}
if (*arg == '-')
usage("fsck-cache [--tags] [[--unreachable] <head-sha1>*]");
}
Expand Down

0 comments on commit ab7df18

Please sign in to comment.