Skip to content

Commit cbb390c

Browse files
committed
An additional test for "git-reset -- path"
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 0e5a7fa commit cbb390c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

t/t7102-reset.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,4 +386,20 @@ test_expect_success 'test --mixed <paths>' '
386386
git diff output cached_expect
387387
'
388388

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+
389405
test_done

0 commit comments

Comments
 (0)