Should "git symbolic-ref -d HEAD" be forbidden?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 1, 2016, 21:08 UTC
- Message-ID
- <xmqqpoonuy4n.fsf@gitster.mtv.corp.google.com>
I think we should.
t1401 expects to be able to, but if you really do it:
$ cd /tmp
$ git init throwaway
$ cd throwaway
$ git symbolic-ref -d HEADthe setup machinery considers that you are no longer in a working tree that is controlled by a repository at .git/ because .git/ is no longer a valid repository, so you cannot even do
$ git symbolic-ref HEAD refs/heads/master
to recover.