diff options
author | Jeff King <peff@peff.net> | 2012-07-25 17:57:30 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-07-25 15:37:05 -0700 |
commit | add416a6c05b580e005726f318463698d746384d (patch) | |
tree | 4e75955f5a3e8a12a7aaf724cb3b6287811a5e54 | |
parent | 468224e580aeb55bd85b37b86f32baada3d17f1e (diff) | |
download | git-add416a6c05b580e005726f318463698d746384d.tar.gz git-add416a6c05b580e005726f318463698d746384d.tar.xz |
checkout: don't confuse ref and object flags
When we are leaving a detached HEAD, we do a revision traversal to
check whether we are orphaning any commits, marking the commit we're
leaving as the start of the traversal, and all existing refs as
uninteresting.
Prior to commit 468224e5, we did so by calling for_each_ref, and
feeding each resulting refname to setup_revisions. Commit 468224e5
refactored this to simply mark the pending objects, saving an extra
lookup.
However, it confused the "flags" parameter to the each_ref_fn
clalback, which is about the flags we found while looking up the ref
with the object flag. Because REF_ISSYMREF ("this ref is a symbolic
ref, e.g. refs/remotes/origin/HEAD") happens to be the same bit
pattern as SEEN ("we have picked this object up from the pending
list and moved it to revs.commits list"), we incorrectly reported
that a commit previously at the detached HEAD will become
unreachable if the only ref that can reach the commit happens to be
pointed at by a symbolic ref.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | builtin/checkout.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index a76899d73..f85548923 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -592,7 +592,7 @@ static int add_pending_uninteresting_ref(const char *refname, const unsigned char *sha1, int flags, void *cb_data) { - add_pending_sha1(cb_data, refname, sha1, flags | UNINTERESTING); + add_pending_sha1(cb_data, refname, sha1, UNINTERESTING); return 0; } |