summaryrefslogtreecommitdiff
path: root/t/t7106-reset-unborn-branch.sh
AgeCommit message (Collapse)AuthorFilesLines
2013-08-24reset test: modernize styleLibravatar Jonathan Nieder1-7/+24
Avoid command substitution and pipes to ensure that the exit status from each git command is tested (and in particular that any segfaults are caught). Maintain the test setup (no commits, one file named "a", another named "b") even after the last test, to make it easier to rearrange tests or add new tests after the last in the future. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-24t/t7106-reset-unborn-branch.sh: Add PERL prerequisiteLibravatar Kacper Kornet1-1/+1
The test 'reset -p' uses git-reset -p, so it depends on the perl code. Signed-off-by: Kacper Kornet <draenog@pld-linux.org> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-15reset: allow reset on unborn branchLibravatar Martin von Zweigbergk1-0/+52
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>