Suggestion: better error reporting when setting HEAD
- From
- Francois Marier <francois@debian.org>
- Date
- Dec 18, 2008, 05:58 UTC
- Message-ID
- <20081218055825.GQ6708@isafjordur.dyndns.org>
(Please CC me on your replies, thanks)
If you take any valid git repo and then do the following:
git symbolic-ref HEAD master (instead of "git symbolic-ref HEAD refs/heads/master")
then other git commands (e.g. "git log") will return this error message:
fatal: Not a git repository
I'd like to suggest two "usability" improvements:
1- changing the error message to explain why the directory is no longer considered a git repo. Maybe something along the lines of:
fatal: Invalid reference in .git/HEAD
2- To prevent this error from happening in the first place, git-symbolic-ref could refuse to change HEAD to a non-existent ref.
Cheers, Francois