From: Junio C Hamano Date: Mon, 27 Feb 2017 21:57:18 +0000 (-0800) Subject: Merge branch 'km/delete-ref-reflog-message' X-Git-Tag: v2.13.0-rc0~155 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c13c783c9d3d7d3eff937b7bf3642d2a7fe32644;p=git Merge branch 'km/delete-ref-reflog-message' "git update-ref -d" and other operations to delete references did not leave any entry in HEAD's reflog when the reference being deleted was the current branch. This is not a problem in practice because you do not want to delete the branch you are currently on, but caused renaming of the current branch to something else not to be logged in a useful way. * km/delete-ref-reflog-message: branch: record creation of renamed branch in HEAD's log rename_ref: replace empty message in HEAD's log update-ref: pass reflog message to delete_ref() delete_ref: accept a reflog message argument --- c13c783c9d3d7d3eff937b7bf3642d2a7fe32644 diff --cc refs/files-backend.c index db3bd42a91,42b137bb1c..b42df147c9 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@@ -2610,8 -2630,8 +2610,8 @@@ static int files_rename_ref(struct ref_ */ if (!read_ref_full(newrefname, RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE, sha1, NULL) && - delete_ref(newrefname, NULL, REF_NODEREF)) { + delete_ref(NULL, newrefname, NULL, REF_NODEREF)) { - if (errno==EISDIR) { + if (errno == EISDIR) { struct strbuf path = STRBUF_INIT; int result;