From: Linus Torvalds Date: Wed, 18 May 2005 17:19:59 +0000 (-0700) Subject: fsck-cache: read the default reference information even when X-Git-Tag: v0.99~557 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e7bd907db6a707481066f2c8d58e208110824358;p=git.git 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. --- diff --git a/fsck-cache.c b/fsck-cache.c index d2aff8c64..c4b1c1ae6 100644 --- a/fsck-cache.c +++ b/fsck-cache.c @@ -419,11 +419,11 @@ int main(int argc, char **argv) } /* - * If we've been asked to do reachability without any explicit - * head information, do the default ones from .git/refs. We also - * consider the index file in this case (ie this implies --cache). + * If we've not been gived any explicit head information, do the + * default ones from .git/refs. We also consider the index file + * in this case (ie this implies --cache). */ - if (show_unreachable && !heads) { + if (!heads) { get_default_heads(); keep_cache_objects = 1; }