diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-01-19 00:49:53 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-01-19 00:49:53 +0300 |
commit | ec27a940134e940a68228401e54f89d610858a26 (patch) | |
tree | 20201a138630a1d06a78cc54d07c4443656d8af1 /t | |
parent | 4744d03a47d668e0e2ea45a637fd16d782e035b9 (diff) | |
parent | 957da7580255f30ce8f1224531e795a9bace3d52 (diff) |
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-x | t/t0030-stripspace.sh | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/t/t0030-stripspace.sh b/t/t0030-stripspace.sh index 5ce47e8af51..0c24a0f9a37 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 ' |