Skip to content

Commit 7084110

Browse files
committed
Fix edit option
Because: * The edit option is broken in v0.6.0, because `$GIT_EDITOR` is set to `:` when the hook is executed by Git - regardless of what the value is in the outer shell. This change: * Removes the $GIT_EDITOR env variable from the editor stack. Fixes #11
1 parent 1985c50 commit 7084110

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hook.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ set_colors() {
4141
#
4242

4343
set_editor() {
44-
HOOK_EDITOR=$GIT_EDITOR
44+
# $GIT_EDITOR appears to always be set to `:` when the hook is executed by Git?
45+
# ref: http://stackoverflow.com/q/41468839/885540
46+
# ref: https://github.com/tommarshall/git-good-commit/issues/11
47+
# HOOK_EDITOR=$GIT_EDITOR
4548
test -z "${HOOK_EDITOR}" && HOOK_EDITOR=$(git config --get core.editor)
4649
test -z "${HOOK_EDITOR}" && HOOK_EDITOR=$VISUAL
4750
test -z "${HOOK_EDITOR}" && HOOK_EDITOR=$EDITOR

0 commit comments

Comments
 (0)