diff options
author | Martin von Zweigbergk <martinvonz@gmail.com> | 2013-01-14 21:47:50 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-01-15 09:38:08 -0800 |
commit | 166ec2e96e31bac913f44823dadd6c732d353172 (patch) | |
tree | 94b6fc2265b3855a39cb890b96c6f94e0789ea67 /t/t4013/diff.log_--root_--patch-with-stat_--summary_master | |
parent | reset $sha1 $pathspec: require $sha1 only to be treeish (diff) | |
download | tgif-166ec2e96e31bac913f44823dadd6c732d353172.tar.xz |
reset: allow reset on unborn branch
Some users seem to think, knowingly or not, that being on an unborn
branch is like having a commit with an empty tree checked out, but
when run on an unborn branch, "git reset" currently fails with:
fatal: Failed to resolve 'HEAD' as a valid ref.
Instead of making users figure out that they should run
git rm --cached -r .
, let's teach "git reset" without a revision argument, when on an
unborn branch, to behave as if the user asked to reset to an empty
tree. Don't take the analogy with an empty commit too far, though, but
still disallow explictly referring to HEAD in "git reset HEAD".
Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.log_--root_--patch-with-stat_--summary_master')
0 files changed, 0 insertions, 0 deletions