| test_description='GIT_EDITOR, core.editor, and stuff' |
| for i in GIT_EDITOR core_editor EDITOR VISUAL vi |
| echo "Edited by $i" >"\$1" |
| unset EDITOR VISUAL GIT_EDITOR |
| test_expect_success setup ' |
| git show -s --pretty=oneline | |
| sed -e "s/^[0-9a-f]* //" >actual && |
| test_expect_success 'dumb should error out when falling back on vi' ' |
| for i in vi EDITOR VISUAL core_editor GIT_EDITOR |
| echo "Edited by $i" >expect |
| unset EDITOR VISUAL GIT_EDITOR |
| git config --unset-all core.editor |
| git config core.editor ./e-core_editor.sh |
| test_expect_success "Using $i" ' |
| git show -s --pretty=oneline | |
| sed -e "s/^[0-9a-f]* //" >actual && |
| unset EDITOR VISUAL GIT_EDITOR |
| git config --unset-all core.editor |
| for i in vi EDITOR VISUAL core_editor GIT_EDITOR |
| echo "Edited by $i" >expect |
| git config core.editor ./e-core_editor.sh |
| test_expect_success "Using $i (override)" ' |
| git show -s --pretty=oneline | |
| sed -e "s/^[0-9a-f]* //" >actual && |