summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2008-07-02 21:32:44 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-07-02 21:32:44 -0700
commit4df0d7af6be27fe5b0ffef438ef0169607253f66 (patch)
tree8d76ec961e9667b4a6efedecb3fd590e38875ba8 /t
parentFix describe --tags --long so it does not segfault (diff)
parentAllow "git-reset path" when unambiguous (diff)
downloadtgif-4df0d7af6be27fe5b0ffef438ef0169607253f66.tar.xz
Merge branch 'jc/maint-reset' into maint
* jc/maint-reset: Allow "git-reset path" when unambiguous
Diffstat (limited to 't')
-rwxr-xr-xt/t7102-reset.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh
index 39ba14148c..96d15083fb 100755
--- a/t/t7102-reset.sh
+++ b/t/t7102-reset.sh
@@ -428,4 +428,51 @@ test_expect_success '--mixed refreshes the index' '
test_cmp expect output
'
+test_expect_success 'disambiguation (1)' '
+
+ git reset --hard &&
+ >secondfile &&
+ git add secondfile &&
+ test_must_fail git reset secondfile &&
+ test -z "$(git diff --cached --name-only)" &&
+ test -f secondfile &&
+ test ! -s secondfile
+
+'
+
+test_expect_success 'disambiguation (2)' '
+
+ git reset --hard &&
+ >secondfile &&
+ git add secondfile &&
+ rm -f secondfile &&
+ test_must_fail git reset secondfile &&
+ test -n "$(git diff --cached --name-only -- secondfile)" &&
+ test ! -f secondfile
+
+'
+
+test_expect_success 'disambiguation (3)' '
+
+ git reset --hard &&
+ >secondfile &&
+ git add secondfile &&
+ rm -f secondfile &&
+ test_must_fail git reset HEAD secondfile &&
+ test -z "$(git diff --cached --name-only)" &&
+ test ! -f secondfile
+
+'
+
+test_expect_success 'disambiguation (4)' '
+
+ git reset --hard &&
+ >secondfile &&
+ git add secondfile &&
+ rm -f secondfile &&
+ test_must_fail git reset -- secondfile &&
+ test -z "$(git diff --cached --name-only)" &&
+ test ! -f secondfile
+'
+
test_done