summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 552e2bd)
raw | patch | inline | side by side (parent: 552e2bd)
author | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Thu, 5 May 2005 00:03:09 +0000 (17:03 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Thu, 5 May 2005 00:03:09 +0000 (17:03 -0700) |
In particular, teach it about tags. Also, to make reachability actually
work for tags, we need to add the ref to the tagged object.
work for tags, we need to add the ref to the tagged object.
fsck-cache.c | patch | blob | history | |
tag.c | patch | blob | history |
diff --git a/fsck-cache.c b/fsck-cache.c
index fb0d82f3320b7971d50d73893d777e3ddf1bd73b..e328cec75d96788622406e6394a67e7a0a96ce7c 100644 (file)
--- a/fsck-cache.c
+++ b/fsck-cache.c
continue;
if (!get_sha1(arg, head_sha1)) {
continue;
if (!get_sha1(arg, head_sha1)) {
- struct commit *commit = lookup_commit(head_sha1);
- struct object *obj;
+ struct object *obj = lookup_object(head_sha1);
- /* Error is printed by lookup_commit(). */
- if (!commit)
+ /* Error is printed by lookup_object(). */
+ if (!obj)
continue;
continue;
- obj = &commit->object;
obj->used = 1;
mark_reachable(obj, REACHABLE);
heads++;
obj->used = 1;
mark_reachable(obj, REACHABLE);
heads++;
index 9eade750d373791420739e494b8f0f0d7367675f..3a71dd416ad18d86ed28ed6593e4588151cc43ea 100644 (file)
--- a/tag.c
+++ b/tag.c
goto err;
item->tagged = parse_object(object);
goto err;
item->tagged = parse_object(object);
+ if (item->tagged)
+ add_ref(&item->object, item->tagged);
type_line = data + 48;
if (memcmp("\ntype ", type_line-1, 6))
type_line = data + 48;
if (memcmp("\ntype ", type_line-1, 6))