X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7005-editor.sh;h=b647957d75fa0d0ce4d88c7c3c7243f31af38b4a;hb=375fe9262b61d924266656ea6615e25a1579c464;hp=c1cec553060a2fd6a4d27191a866b3bf53ba3335;hpb=f124e986cf19e8f36895ae474d50f8d389e73d02;p=git.git diff --git a/t/t7005-editor.sh b/t/t7005-editor.sh index c1cec5530..b647957d7 100755 --- a/t/t7005-editor.sh +++ b/t/t7005-editor.sh @@ -4,11 +4,10 @@ test_description='GIT_EDITOR, core.editor, and stuff' . ./test-lib.sh -OLD_TERM="$TERM" - for i in GIT_EDITOR core_editor EDITOR VISUAL vi do cat >e-$i.sh <<-EOF + #!$SHELL_PATH echo "Edited by $i" >"\$1" EOF chmod +x e-$i.sh @@ -89,6 +88,27 @@ do ' done -TERM="$OLD_TERM" +if ! echo 'echo space > "$1"' > "e space.sh" +then + say "Skipping; FS does not support spaces in filenames" + test_done +fi + +test_expect_success 'editor with a space' ' + + chmod a+x "e space.sh" && + GIT_EDITOR="./e\ space.sh" git commit --amend && + test space = "$(git show -s --pretty=format:%s)" + +' + +unset GIT_EDITOR +test_expect_success 'core.editor with a space' ' + + git config core.editor \"./e\ space.sh\" && + git commit --amend && + test space = "$(git show -s --pretty=format:%s)" + +' test_done