'
strip_comments () {
- sed "s/^\# //; s/^\#$//; s/^#\t/\t/" <"$1" >"$1".tmp &&
+ tab=' '
+ sed "s/^\# //; s/^\#$//; s/^#$tab/$tab/" <"$1" >"$1".tmp &&
rm "$1" && mv "$1".tmp "$1"
}
#
# dir1/untracked dir2/untracked output
# dir2/modified expect untracked
+#
EOF
COLUMNS=50 git -c status.displayCommentPrefix=true status --column="column dense" >output &&
test_i18ncmp expect output
# expect
# output
# untracked
+#
EOF
test_expect_success 'status with status.displayCommentPrefix=true' '
expect
output
untracked
+
EOF
test_expect_success 'status (advice.statusHints false)' '
(use "git add <file>..." to include in what will be committed)
dir2/modified
+
Ignored files:
(use "git add -f <file>..." to include in what will be committed)
expect
output
untracked
+
EOF
git status --ignored >output &&
test_i18ncmp expect output
expect
output
untracked
+
EOF
git status --ignored >output &&
test_i18ncmp expect output
expect
output
untracked
+
EOF
git status -unormal >output &&
test_i18ncmp expect output
expect
output
untracked
+
EOF
git status -uall >output &&
test_i18ncmp expect output
../expect
../output
../untracked
+
EOF
(cd dir1 && git status) >output &&
test_i18ncmp expect output
<BLUE>expect<RESET>
<BLUE>output<RESET>
<BLUE>untracked<RESET>
+
EOF
test_config color.ui always &&
git status | test_decode_color >output &&
expect
output
untracked
+
EOF
test_config status.relativePaths false &&
(cd dir1 && git status) >output &&
expect
output
untracked
+
EOF
git commit --dry-run dir1/modified >output &&
test_i18ncmp expect output
expect
output
untracked
+
EOF
git status >output &&
test_i18ncmp expect output
expect
output
untracked
+
EOF
git config status.submodulesummary 10 &&
git status >output &&
expect
output
untracked
+
no changes added to commit (use "git add" and/or "git commit -a")
EOF
git commit -m "commit submodule" &&
test_expect_success 'status -z implies porcelain' '
git status --porcelain |
- "$PERL_PATH" -pe "s/\012/\000/g" >expect &&
+ perl -pe "s/\012/\000/g" >expect &&
git status -z >output &&
test_cmp expect output
'
expect
output
untracked
+
EOF
git config status.submodulesummary 10 &&
git commit --dry-run --amend >output &&
expect
output
untracked
+
EOF
echo modified sm/untracked &&
git status --ignore-submodules=untracked >output &&
expect
output
untracked
+
EOF
git status --ignore-submodules=untracked > output &&
test_i18ncmp expect output
expect
output
untracked
+
EOF
git status --ignore-submodules=untracked > output &&
test_i18ncmp expect output
; expect
; output
; untracked
+;
EOF
test_expect_success "status (core.commentchar with submodule summary)" '
expect
output
untracked
+
no changes added to commit (use "git add" and/or "git commit -a")
EOF
git status --ignore-submodules=all > output &&
test_i18ncmp expect output
'
-test_expect_failure '.gitmodules ignore=all suppresses submodule summary' '
+test_expect_success '.gitmodules ignore=all suppresses submodule summary' '
git config --add -f .gitmodules submodule.subname.ignore all &&
git config --add -f .gitmodules submodule.subname.path sm &&
git status > output &&
git config -f .gitmodules --remove-section submodule.subname
'
-test_expect_failure '.git/config ignore=all suppresses submodule summary' '
+test_expect_success '.git/config ignore=all suppresses submodule summary' '
git config --add -f .gitmodules submodule.subname.ignore none &&
git config --add -f .gitmodules submodule.subname.path sm &&
git config --add submodule.subname.ignore all &&