Teach the '@{...}' notation to git-log -g
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>
Thu, 1 Feb 2007 23:07:24 +0000 (00:07 +0100)
committerJunio C Hamano <junkio@cox.net>
Fri, 2 Feb 2007 05:50:16 +0000 (21:50 -0800)
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
reflog-walk.c

index 82621601d63fff25c46d96b0ade5058fe4e16a28..653ec956f08141b3e15f52665cef7a260f8ed6a4 100644 (file)
@@ -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);