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()
This commit is contained in:
Junio C Hamano
2020-09-18 17:58:04 -07:00
7 changed files with 94 additions and 60 deletions

View File

@ -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