aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-09-13 20:54:14 -0700
committerJunio C Hamano <gitster@pobox.com>2007-09-13 20:54:14 -0700
commitcbb390cd8f58ca6fc5c7b2c710425649b057b6d6 (patch)
tree98e1f1d41b19c684cc3c01de9b012eece99f4f5a /t
parent0e5a7faa3a903cf7a0a66c81e20a76b91f17faab (diff)
downloadgit-cbb390cd8f58ca6fc5c7b2c710425649b057b6d6.tar.gz
git-cbb390cd8f58ca6fc5c7b2c710425649b057b6d6.tar.xz
An additional test for "git-reset -- path"
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7102-reset.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh
index 2cad4db12..f64b1cbf7 100755
--- a/t/t7102-reset.sh
+++ b/t/t7102-reset.sh
@@ -386,4 +386,20 @@ test_expect_success 'test --mixed <paths>' '
git diff output cached_expect
'
+test_expect_success 'test resetting the index at give paths' '
+
+ mkdir sub &&
+ >sub/file1 &&
+ >sub/file2 &&
+ git update-index --add sub/file1 sub/file2 &&
+ T=$(git write-tree) &&
+ ! git reset HEAD sub/file2 &&
+ U=$(git write-tree) &&
+ echo "$T" &&
+ echo "$U" &&
+ ! git diff-index --cached --exit-code "$T" &&
+ test "$T" != "$U"
+
+'
+
test_done