diff options
author | Junio C Hamano <junkio@cox.net> | 2007-02-04 06:14:40 (GMT) |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-02-04 07:05:34 (GMT) |
commit | d77ee72662a821d66ae218056f0103eb24d8d4b4 (patch) | |
tree | e22abdbd11735a0669362f934ae723d233c87e2b /reflog-walk.c | |
parent | eb8381c88518b10d683a29deea1d43ed671f14ec (diff) | |
parent | 8d0fc48f27304ac1bc7abf802ec53fe66fedb15a (diff) | |
download | git-d77ee72662a821d66ae218056f0103eb24d8d4b4.zip git-d77ee72662a821d66ae218056f0103eb24d8d4b4.tar.gz git-d77ee72662a821d66ae218056f0103eb24d8d4b4.tar.bz2 |
Merge branch 'master' into np/dreflog
This is to resolve conflicts early in preparation for possible
inclusion of "reflog on detached HEAD" series by Nico, as having
it in 1.5.0 would really help us remove confusion between
detached and attached states.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'reflog-walk.c')
-rw-r--r-- | reflog-walk.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/reflog-walk.c b/reflog-walk.c index 8262160..653ec95 100644 --- a/reflog-walk.c +++ b/reflog-walk.c @@ -165,6 +165,14 @@ void add_reflog_for_walk(struct reflog_walk_info *info, if (item) reflogs = item->util; else { + if (*branch == '\0') { + unsigned char sha1[20]; + const char *head = resolve_ref("HEAD", sha1, 0, NULL); + if (!head) + die ("No current branch"); + free(branch); + branch = xstrdup(head); + } reflogs = read_complete_reflog(branch); if (!reflogs || reflogs->nr == 0) die("No reflogs found for '%s'", branch); |