-
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.
Merge branch 'maint-1.6.4' into maint
* maint-1.6.4: ls-files: excludes should not impact tracked files
- Loading branch information
Showing
2 changed files
with
32 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
|
||
test_description='ls-files --exclude does not affect index files' | ||
. ./test-lib.sh | ||
|
||
test_expect_success 'create repo with file' ' | ||
echo content >file && | ||
git add file && | ||
git commit -m file && | ||
echo modification >file | ||
' | ||
|
||
check_output() { | ||
test_expect_success "ls-files output contains file ($1)" " | ||
echo '$2' >expect && | ||
git ls-files --exclude-standard --$1 >output && | ||
test_cmp expect output | ||
" | ||
} | ||
|
||
check_all_output() { | ||
check_output 'cached' 'file' | ||
check_output 'modified' 'file' | ||
} | ||
|
||
check_all_output | ||
test_expect_success 'add file to gitignore' ' | ||
echo file >.gitignore | ||
' | ||
check_all_output | ||
|
||
test_done |