Skip to content

Commit 55beff4

Browse files
committed
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 <[email protected]>
1 parent 38881a9 commit 55beff4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

builtin-reflog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,8 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
604604
continue;
605605
}
606606

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]);
609609
continue;
610610
}
611611

t/t1410-reflog.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ test_expect_success 'recover and check' '
175175
176176
'
177177

178-
test_expect_failure 'delete' '
178+
test_expect_success 'delete' '
179179
echo 1 > C &&
180180
test_tick &&
181181
git commit -m rat C &&

0 commit comments

Comments
 (0)