Skip to content

Commit

Permalink
Fix deleting reflog entries from HEAD reflog
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Aug 11, 2008
1 parent 38881a9 commit 55beff4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions builtin-reflog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion t/t1410-reflog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit 55beff4

Please sign in to comment.