aboutsummaryrefslogtreecommitdiff
path: root/fsck-cache.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-04 17:03:09 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-04 17:03:09 -0700
commit770896e548d0e68ab120507895e1e878c5ee347c (patch)
tree789eaf8c1ac87a1d7115b0a47d1300ba191cff1d /fsck-cache.c
parent552e2bd12ee7b3a73345f64cf66b2ce67d9d98dd (diff)
downloadgit-770896e548d0e68ab120507895e1e878c5ee347c.tar.gz
git-770896e548d0e68ab120507895e1e878c5ee347c.tar.xz
Teach fsck-cache to accept non-commits for reachability analysis.
In particular, teach it about tags. Also, to make reachability actually work for tags, we need to add the ref to the tagged object.
Diffstat (limited to 'fsck-cache.c')
-rw-r--r--fsck-cache.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fsck-cache.c b/fsck-cache.c
index fb0d82f33..e328cec75 100644
--- a/fsck-cache.c
+++ b/fsck-cache.c
@@ -295,14 +295,12 @@ int main(int argc, char **argv)
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;
- obj = &commit->object;
obj->used = 1;
mark_reachable(obj, REACHABLE);
heads++;