X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=reflog-walk.c;h=c983858259f717b3ed9d0f00921aec92219c1ad3;hb=3358004a006714477c2c44577507081cb5124fa4;hp=afe1577d76ebd06e323d478f616c838142fa02d0;hpb=4e244cbc5cc4c8a43982d4023bc0d9fb0b0c7d43;p=git.git diff --git a/reflog-walk.c b/reflog-walk.c index afe1577d7..c98385825 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