summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-01-18 13:49:53 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-01-18 13:49:53 -0800
commitec27a940134e940a68228401e54f89d610858a26 (patch)
tree20201a138630a1d06a78cc54d07c4443656d8af1 /t
parentMerge branch 'sb/submodule-fetchjobs-default-to-one' (diff)
parentstripspace: allow -s/-c outside git repository (diff)
downloadtgif-ec27a940134e940a68228401e54f89d610858a26.tar.xz
Merge branch 'jn/stripspace-wo-repository'
"git stripspace" should be usable outside a git repository, but under the "-s" or "-c" mode, it didn't. * jn/stripspace-wo-repository: stripspace: allow -s/-c outside git repository
Diffstat (limited to 't')
-rwxr-xr-xt/t0030-stripspace.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/t/t0030-stripspace.sh b/t/t0030-stripspace.sh
index 5ce47e8af5..0c24a0f9a3 100755
--- a/t/t0030-stripspace.sh
+++ b/t/t0030-stripspace.sh
@@ -430,9 +430,15 @@ test_expect_success '-c with changed comment char' '
test_expect_success '-c with comment char defined in .git/config' '
test_config core.commentchar = &&
printf "= foo\n" >expect &&
- printf "foo" | (
- mkdir sub && cd sub && git stripspace -c
- ) >actual &&
+ rm -fr sub &&
+ mkdir sub &&
+ printf "foo" | git -C sub stripspace -c >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success '-c outside git repository' '
+ printf "# foo\n" >expect &&
+ printf "foo" | nongit git stripspace -c >actual &&
test_cmp expect actual
'