summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-09-10 17:01:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-09-10 20:07:24 (GMT)
commita361dd3f798968b3be4bd10d0f4133dc1f48e50b (patch)
treeba12173f387f29620b67174e649f65f67cec3397 /t
parente2773aa45f673d26fe425cc5423299726f299f0b (diff)
downloadgit-a361dd3f798968b3be4bd10d0f4133dc1f48e50b.zip
git-a361dd3f798968b3be4bd10d0f4133dc1f48e50b.tar.gz
git-a361dd3f798968b3be4bd10d0f4133dc1f48e50b.tar.bz2
wt-status: consistently quote paths in "status --short" output
Tracked paths with SP in them were cquoted in "git status --short" output, but untracked, ignored, and unmerged paths weren't. The test was stolen from a patch to fix output for the 'untracked' paths by brian m. carlson, with similar tests added for 'ignored' ones. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7508-status.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index e817593..2e9c6da 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