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.
This commit is contained in:
parent
552e2bd12e
commit
770896e548
@ -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++;
|
||||
|
Loading…
Reference in New Issue
Block a user