aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-07-01 16:22:19 -0700
committerJunio C Hamano <gitster@pobox.com>2008-07-01 16:22:19 -0700
commit24cd49f627ab0d313f8f7925e1f6f855563fea43 (patch)
tree57e84d18b0469e5eda3d8646b6d70da9e6b50a09 /t
parente74776b0d82326cd1cd09b01189105f323bef0ec (diff)
parentdfc8f39e4346d000052c39ef7cb6bfe8fdb48c51 (diff)
downloadgit-24cd49f627ab0d313f8f7925e1f6f855563fea43.tar.gz
git-24cd49f627ab0d313f8f7925e1f6f855563fea43.tar.xz
Merge branch 'jc/maint-reset'
* 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 39ba14148..96d15083f 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