Skip to content

Commit d271fd5

Browse files
dschoJunio C Hamano
authored andcommitted
Teach the '@{...}' notation to git-log -g
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 11cf880 commit d271fd5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

reflog-walk.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,14 @@ void add_reflog_for_walk(struct reflog_walk_info *info,
165165
if (item)
166166
reflogs = item->util;
167167
else {
168+
if (*branch == '\0') {
169+
unsigned char sha1[20];
170+
const char *head = resolve_ref("HEAD", sha1, 0, NULL);
171+
if (!head)
172+
die ("No current branch");
173+
free(branch);
174+
branch = xstrdup(head);
175+
}
168176
reflogs = read_complete_reflog(branch);
169177
if (!reflogs || reflogs->nr == 0)
170178
die("No reflogs found for '%s'", branch);

0 commit comments

Comments
 (0)