summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9174026)
raw | patch | inline | side by side (parent: 9174026)
author | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Sat, 9 Apr 2005 20:02:30 +0000 (13:02 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Sat, 9 Apr 2005 20:02:30 +0000 (13:02 -0700) |
Once I do the reference tracking, I'll also make it print out all the
HEAD commits it finds, which is even more interesting.
HEAD commits it finds, which is even more interesting.
fsck-cache.c | patch | blob | history |
diff --git a/fsck-cache.c b/fsck-cache.c
index a01513ed4d4d565911a60981bfb4173311ba3688..ac348b7d5278e9d04e3a1cd417389379c32b014f 100644 (file)
--- a/fsck-cache.c
+++ b/fsck-cache.c
static int fsck_commit(unsigned char *sha1, void *data, unsigned long size)
{
+ int parents;
unsigned char tree_sha1[20];
unsigned char parent_sha1[20];
return -1;
mark_needs_sha1(sha1, "tree", tree_sha1);
data += 5 + 40 + 1; /* "tree " + <hex sha1> + '\n' */
+ parents = 0;
while (!memcmp(data, "parent ", 7)) {
if (get_sha1_hex(data + 7, parent_sha1) < 0)
return -1;
mark_needs_sha1(sha1, "commit", parent_sha1);
data += 7 + 40 + 1; /* "parent " + <hex sha1> + '\n' */
+ parents++;
}
+ if (!parents)
+ printf("root: %s\n", sha1_to_hex(sha1));
return 0;
}