@matheusbsbs / matheus-bagliano / commits / 55beff4f53
Fork 0

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 <gitster@pobox.com>

Junio C Hamano committed Aug 10, 2008 at 23:21 UTC 55beff4f536011e5d7f17ae63911f1bb56308feb
2 files changed +3 -3
builtin-reflog.c
+2 -2
@@ -604,8 +604,8 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
604 continue;
605 }
606
607 - if (!dwim_ref(argv[i], spec - argv[i], sha1, &ref)) {
608 - status |= error("%s points nowhere!", argv[i]);
607 + if (!dwim_log(argv[i], spec - argv[i], sha1, &ref)) {
608 + status |= error("no reflog for '%s'", argv[i]);
609 continue;
610 }
611
t/t1410-reflog.sh
+1 -1
@@ -175,7 +175,7 @@ test_expect_success 'recover and check' '
175
176 '
177
178 -test_expect_failure 'delete' '
178 +test_expect_success 'delete' '
179 echo 1 > C &&
180 test_tick &&
181 git commit -m rat C &&