diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2007-02-09 01:28:23 +0100 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-02-08 17:48:22 -0800 |
commit | eb3a48221fd4a0b38c31976028dbab7df51be6d4 (patch) | |
tree | 054ee03e6d638c4fdd9f2d5ac9ed5f29bbcf2e54 /reflog-walk.c | |
parent | e00de24b102da647485aeeeff278c21ab31420a2 (diff) | |
download | git-eb3a48221fd4a0b38c31976028dbab7df51be6d4.tar.gz |
log --reflog: use dwim_log
Since "git log origin/master" uses dwim_log() to match
"refs/remotes/origin/master", it makes sense to do that for
"git log --reflog", too.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
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 |