diff options
Diffstat (limited to 'reflog-walk.c')
-rw-r--r-- | reflog-walk.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/reflog-walk.c b/reflog-walk.c index afe1577d76..c983858259 100644 --- a/reflog-walk.c +++ b/reflog-walk.c @@ -174,6 +174,19 @@ void add_reflog_for_walk(struct reflog_walk_info *info, branch = xstrdup(head); } reflogs = read_complete_reflog(branch); + if (!reflogs || reflogs->nr == 0) { + unsigned char sha1[20]; + char *b; + if (dwim_log(branch, strlen(branch), sha1, &b) == 1) { + if (reflogs) { + free(reflogs->ref); + free(reflogs); + } + free(branch); + branch = b; + reflogs = read_complete_reflog(branch); + } + } if (!reflogs || reflogs->nr == 0) die("No reflogs found for '%s'", branch); path_list_insert(branch, &info->complete_reflogs)->util |