Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
And here is a small test script that makes sure that: - both modified and new files are included, - removed file is noticed, and - no ignored file is included. Signed-off-by: Junio C Hamano <gitster@pobox.com>
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/sh | ||
|
||
test_description='git add --all' | ||
|
||
. ./test-lib.sh | ||
|
||
test_expect_success setup ' | ||
( | ||
echo .gitignore | ||
echo will-remove | ||
) >expect && | ||
( | ||
echo actual | ||
echo expect | ||
echo ignored | ||
) >.gitignore && | ||
>will-remove && | ||
git add --all && | ||
test_tick && | ||
git commit -m initial && | ||
git ls-files >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success 'git add --all' ' | ||
( | ||
echo .gitignore | ||
echo not-ignored | ||
echo "M .gitignore" | ||
echo "A not-ignored" | ||
echo "D will-remove" | ||
) >expect && | ||
>ignored && | ||
>not-ignored && | ||
echo modification >>.gitignore && | ||
rm -f will-remove && | ||
git add --all && | ||
git update-index --refresh && | ||
git ls-files >actual && | ||
git diff-index --name-status --cached HEAD >>actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_done |