summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-26 21:48:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-01-26 21:49:50 (GMT)
commit105e47339794ec2c862338d7a25df77b7d72385e (patch)
tree1cb3327d57a774868e62dc6f4593e7aa97dedfeb /revision.c
parente3f67d30b20e49d8fc3eefe819808cba7998b060 (diff)
downloadgit-105e47339794ec2c862338d7a25df77b7d72385e.zip
git-105e47339794ec2c862338d7a25df77b7d72385e.tar.gz
git-105e47339794ec2c862338d7a25df77b7d72385e.tar.bz2
Fix log -g this@{upstream}
It showed the correct objects but walked a wrong reflog. Again, tests are from Jeff King. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/revision.c b/revision.c
index f54d43f..3ba6d99 100644
--- a/revision.c
+++ b/revision.c
@@ -134,10 +134,20 @@ static void add_pending_object_with_mode(struct rev_info *revs, struct object *o
{
if (revs->no_walk && (obj->flags & UNINTERESTING))
revs->no_walk = 0;
- if (revs->reflog_info && obj->type == OBJ_COMMIT &&
- add_reflog_for_walk(revs->reflog_info,
- (struct commit *)obj, name))
- return;
+ if (revs->reflog_info && obj->type == OBJ_COMMIT) {
+ struct strbuf buf = STRBUF_INIT;
+ int len = interpret_branch_name(name, &buf);
+ int st;
+
+ if (0 < len && name[len] && buf.len)
+ strbuf_addstr(&buf, name + len);
+ st = add_reflog_for_walk(revs->reflog_info,
+ (struct commit *)obj,
+ buf.buf[0] ? buf.buf: name);
+ strbuf_release(&buf);
+ if (st)
+ return;
+ }
add_object_array_with_mode(obj, name, &revs->pending, mode);
}