Browse Source
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 consistentmaint
Junio C Hamano
12 years ago
3 changed files with 225 additions and 22 deletions
@ -0,0 +1,146 @@
@@ -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 |
Loading…
Reference in new issue