From: Junio C Hamano Date: Mon, 11 Aug 2008 06:21:25 +0000 (-0700) Subject: Fix deleting reflog entries from HEAD reflog X-Git-Tag: v1.6.0-rc3~1^2~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=55beff4f536011e5d7f17ae63911f1bb56308feb;p=git.git Fix deleting reflog entries from HEAD reflog dwim_ref() used to resolve HEAD symbolic ref to its target (i.e. current branch). This incorrectly removed the reflog entry from the current branch when 'git reflog delete HEAD@{1}' was asked for. Signed-off-by: Junio C Hamano --- diff --git a/builtin-reflog.c b/builtin-reflog.c index 125d455b9..7d7047d79 100644 --- a/builtin-reflog.c +++ b/builtin-reflog.c @@ -604,8 +604,8 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix) continue; } - if (!dwim_ref(argv[i], spec - argv[i], sha1, &ref)) { - status |= error("%s points nowhere!", argv[i]); + if (!dwim_log(argv[i], spec - argv[i], sha1, &ref)) { + status |= error("no reflog for '%s'", argv[i]); continue; } diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh index 3b9860ea2..5b24f0557 100755 --- a/t/t1410-reflog.sh +++ b/t/t1410-reflog.sh @@ -175,7 +175,7 @@ test_expect_success 'recover and check' ' ' -test_expect_failure 'delete' ' +test_expect_success 'delete' ' echo 1 > C && test_tick && git commit -m rat C &&