fsck-cache: read the default reference information even when

not doing reachability analysis.

This avoids the dangling head problem, and means that just a
plain "git-fsck-cache" with no parameters will DTRT.
This commit is contained in:
Linus Torvalds 2005-05-18 10:19:59 -07:00
parent 1024932f01
commit e7bd907db6

View File

@ -419,11 +419,11 @@ int main(int argc, char **argv)
} }
/* /*
* If we've been asked to do reachability without any explicit * If we've not been gived any explicit head information, do the
* head information, do the default ones from .git/refs. We also * default ones from .git/refs. We also consider the index file
* consider the index file in this case (ie this implies --cache). * in this case (ie this implies --cache).
*/ */
if (show_unreachable && !heads) { if (!heads) {
get_default_heads(); get_default_heads();
keep_cache_objects = 1; keep_cache_objects = 1;
} }