Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: [PATCH 2/2] builtin-reflog: fix deletion of HEAD entries

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:07
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

Junio C Hamano [off-list ref] writes:
Pieter de Bie [off-list ref] writes:
quoted
dwim_ref() used to resolve HEAD to its symlink (like refs/heads/master),
making a call to 'git reflog delete HEAD@{1}' to actually delete the second
entry in the master reflog.

This patch makes a special case for HEAD (as that's the only non-branch
reflog we keep), fixing the issue.
What happens to remotes/origin/HEAD that points at remotes/origin/master?
Perhaps this might work better?

 builtin-reflog.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-reflog.c b/builtin-reflog.c
index 0c34e37..a48f664 100644
--- a/builtin-reflog.c
+++ b/builtin-reflog.c
@@ -604,7 +604,7 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
 			continue;
 		}
 
-		if (!dwim_ref(argv[i], spec - argv[i], sha1, &ref)) {
+		if (!dwim_log(argv[i], spec - argv[i], sha1, &ref)) {
 			status |= error("%s points nowhere!", argv[i]);
 			continue;
 		}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help