-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* jc/add-addremove: git-add --all: documentation git-add --all: tests git-add --all: add all files builtin-add.c: restructure the code for maintainability Conflicts: builtin-add.c
- Loading branch information
Showing
3 changed files
with
104 additions
and
34 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
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
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 |