@matheusbsbs / matheus-bagliano / commits / cbb390cd8f
Fork 0

An additional test for "git-reset -- path"

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Sep 13, 2007 at 20:54 UTC cbb390cd8f58ca6fc5c7b2c710425649b057b6d6
1 file changed +16
t/t7102-reset.sh
+16
@@ -386,4 +386,20 @@ test_expect_success 'test --mixed <paths>' '
386 git diff output cached_expect
387 '
388
389 +test_expect_success 'test resetting the index at give paths' '
390 +
391 + mkdir sub &&
392 + >sub/file1 &&
393 + >sub/file2 &&
394 + git update-index --add sub/file1 sub/file2 &&
395 + T=$(git write-tree) &&
396 + ! git reset HEAD sub/file2 &&
397 + U=$(git write-tree) &&
398 + echo "$T" &&
399 + echo "$U" &&
400 + ! git diff-index --cached --exit-code "$T" &&
401 + test "$T" != "$U"
402 +
403 +'
404 +
405 test_done