HEAD's reflog entry for a renamed branch
- From
Kyle Meyer <kyle@kyleam.com>
- Date
- Jan 16, 2017, 23:17 UTC
- Message-ID
- <87pojmwq5y.fsf@kyleam.com>
Hello,
I noticed that, after renaming the current branch, the corresponding message in .git/logs/HEAD is empty.
For example, running
$ mkdir test-repo
$ cd test-repo
$ git init
$ echo abc >file.txt
$ git add file.txt
$ git commit -m"Add file.txt"
$ git branch -m master new-masterresulted in the following reflogs:
$ cat .git/logs/refs/heads/new-master 00000... 68730... Kyle Meyer <kyle@kyleam.com> 1484607020 -0500 commit (initial): Add file.txt 68730... 68730... Kyle Meyer <kyle@kyleam.com> 1484607020 -0500 Branch: renamed refs/heads/master to refs/heads/new-master
$ cat .git/logs/HEAD 00000... 68730... Kyle Meyer <kyle@kyleam.com> 1484607020 -0500 commit (initial): Add file.txt 68730... 00000... Kyle Meyer <kyle@kyleam.com> 1484607020 -0500
I expected the second line of .git/logs/HEAD to mirror the second line of .git/logs/refs/heads/new-master. Are the empty message and null sha1 in HEAD's entry intentional?
-- Kyle