-
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 'ap/status-ignored-in-ignored-directory' into maint
Output from "git status --ignored" did not work well when used with "--untracked". * ap/status-ignored-in-ignored-directory: status: always report ignored tracked directories git-status: Test --ignored behavior dir.c: Make git-status --ignored more consistent
- Loading branch information
Showing
3 changed files
with
225 additions
and
22 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,146 @@ | ||
#!/bin/sh | ||
|
||
test_description='git-status ignored files' | ||
|
||
. ./test-lib.sh | ||
|
||
cat >expected <<\EOF | ||
?? .gitignore | ||
?? actual | ||
?? expected | ||
?? untracked/ | ||
EOF | ||
|
||
test_expect_success 'status untracked directory with --ignored' ' | ||
echo "ignored" >.gitignore && | ||
mkdir untracked && | ||
: >untracked/ignored && | ||
: >untracked/uncommitted && | ||
git status --porcelain --ignored >actual && | ||
test_cmp expected actual | ||
' | ||
|
||
cat >expected <<\EOF | ||
?? .gitignore | ||
?? actual | ||
?? expected | ||
?? untracked/uncommitted | ||
!! untracked/ignored | ||
EOF | ||
|
||
test_expect_success 'status untracked directory with --ignored -u' ' | ||
git status --porcelain --ignored -u >actual && | ||
test_cmp expected actual | ||
' | ||
|
||
cat >expected <<\EOF | ||
?? .gitignore | ||
?? actual | ||
?? expected | ||
!! ignored/ | ||
EOF | ||
|
||
test_expect_success 'status ignored directory with --ignore' ' | ||
rm -rf untracked && | ||
mkdir ignored && | ||
: >ignored/uncommitted && | ||
git status --porcelain --ignored >actual && | ||
test_cmp expected actual | ||
' | ||
|
||
cat >expected <<\EOF | ||
?? .gitignore | ||
?? actual | ||
?? expected | ||
!! ignored/uncommitted | ||
EOF | ||
|
||
test_expect_success 'status ignored directory with --ignore -u' ' | ||
git status --porcelain --ignored -u >actual && | ||
test_cmp expected actual | ||
' | ||
|
||
cat >expected <<\EOF | ||
?? .gitignore | ||
?? actual | ||
?? expected | ||
!! untracked-ignored/ | ||
EOF | ||
|
||
test_expect_success 'status untracked directory with ignored files with --ignore' ' | ||
rm -rf ignored && | ||
mkdir untracked-ignored && | ||
mkdir untracked-ignored/test && | ||
: >untracked-ignored/ignored && | ||
: >untracked-ignored/test/ignored && | ||
git status --porcelain --ignored >actual && | ||
test_cmp expected actual | ||
' | ||
|
||
cat >expected <<\EOF | ||
?? .gitignore | ||
?? actual | ||
?? expected | ||
!! untracked-ignored/ignored | ||
!! untracked-ignored/test/ignored | ||
EOF | ||
|
||
test_expect_success 'status untracked directory with ignored files with --ignore -u' ' | ||
git status --porcelain --ignored -u >actual && | ||
test_cmp expected actual | ||
' | ||
|
||
cat >expected <<\EOF | ||
?? .gitignore | ||
?? actual | ||
?? expected | ||
EOF | ||
|
||
test_expect_success 'status ignored tracked directory with --ignore' ' | ||
rm -rf untracked-ignored && | ||
mkdir tracked && | ||
: >tracked/committed && | ||
git add tracked/committed && | ||
git commit -m. && | ||
echo "tracked" >.gitignore && | ||
git status --porcelain --ignored >actual && | ||
test_cmp expected actual | ||
' | ||
|
||
cat >expected <<\EOF | ||
?? .gitignore | ||
?? actual | ||
?? expected | ||
EOF | ||
|
||
test_expect_success 'status ignored tracked directory with --ignore -u' ' | ||
git status --porcelain --ignored -u >actual && | ||
test_cmp expected actual | ||
' | ||
|
||
cat >expected <<\EOF | ||
?? .gitignore | ||
?? actual | ||
?? expected | ||
!! tracked/ | ||
EOF | ||
|
||
test_expect_success 'status ignored tracked directory and uncommitted file with --ignore' ' | ||
: >tracked/uncommitted && | ||
git status --porcelain --ignored >actual && | ||
test_cmp expected actual | ||
' | ||
|
||
cat >expected <<\EOF | ||
?? .gitignore | ||
?? actual | ||
?? expected | ||
!! tracked/uncommitted | ||
EOF | ||
|
||
test_expect_success 'status ignored tracked directory and uncommitted file with --ignore -u' ' | ||
git status --porcelain --ignored -u >actual && | ||
test_cmp expected actual | ||
' | ||
|
||
test_done |
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