Skip to content

Commit

Permalink
An additional test for "git-reset -- path"
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Sep 14, 2007
1 parent 0e5a7fa commit cbb390c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions t/t7102-reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit cbb390c

Please sign in to comment.