From cbb390cd8f58ca6fc5c7b2c710425649b057b6d6 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 13 Sep 2007 20:54:14 -0700 Subject: [PATCH] An additional test for "git-reset -- path" Signed-off-by: Junio C Hamano --- t/t7102-reset.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 ' ' 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 -- 2.30.2