diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-09-18 17:58:04 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-09-18 17:58:04 -0700 |
commit | 9d4e7ec4d9e695d95cc7474f59fba8cc38580e29 (patch) | |
tree | 22db63f4315c0e6698d67c879c73520ef4074c39 /t | |
parent | Merge branch 'os/collect-changed-submodules-optim' (diff) | |
parent | quote: turn 'nodq' parameter into a set of flags (diff) | |
download | tgif-9d4e7ec4d9e695d95cc7474f59fba8cc38580e29.tar.xz |
Merge branch 'jc/quote-path-cleanup'
"git status --short" quoted a path with SP in it when tracked, but
not those that are untracked, ignored or unmerged. They are all
shown quoted consistently.
* jc/quote-path-cleanup:
quote: turn 'nodq' parameter into a set of flags
quote: rename misnamed sq_lookup[] to cq_lookup[]
wt-status: consistently quote paths in "status --short" output
quote_path: code clarification
quote_path: optionally allow quoting a path with SP in it
quote_path: give flags parameter to quote_path()
quote_path: rename quote_path_relative() to quote_path()
Diffstat (limited to 't')
-rwxr-xr-x | t/t7508-status.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/t/t7508-status.sh b/t/t7508-status.sh index 45e1f6ff68..963fed6821 100755 --- a/t/t7508-status.sh +++ b/t/t7508-status.sh @@ -814,6 +814,33 @@ test_expect_success 'status -s without relative paths' ' ' +cat >expect <<\EOF + M dir1/modified +A dir2/added +A "file with spaces" +?? dir1/untracked +?? dir2/modified +?? dir2/untracked +?? "file with spaces 2" +?? untracked +EOF + +test_expect_success 'status -s without relative paths' ' + test_when_finished "git rm --cached \"file with spaces\"; rm -f file*" && + >"file with spaces" && + >"file with spaces 2" && + >"expect with spaces" && + git add "file with spaces" && + + git status -s >output && + test_cmp expect output && + + git status -s --ignored >output && + grep "^!! \"expect with spaces\"$" output && + grep -v "^!! " output >output-wo-ignored && + test_cmp expect output-wo-ignored +' + test_expect_success 'dry-run of partial commit excluding new file in index' ' cat >expect <<EOF && On branch master |