Save/restore the git commit message in case a git pre-commit hook fails. Also rename the APPEND var to GIT_COMMIT_MSG_SUFFIX.

This commit is contained in:
Nathan Broadbent
2018-09-26 23:04:51 +07:00
parent 1f60a87a77
commit 8233abd23f
3 changed files with 53 additions and 19 deletions

View File

@@ -35,11 +35,11 @@ if [[ "$git_keyboard_shortcuts_enabled" = "true" ]]; then
if [[ $shell == "zsh" ]]; then
_bind "$git_commit_all_keys" " git_commit_all""$RETURN_CHAR"
_bind "$git_add_and_commit_keys" " \033[1~ git_add_and_commit ""$RETURN_CHAR"
_bind "$git_commit_all_with_ci_skip_keys" " \033[1~ APPEND='[ci skip]' git_commit_all ""$RETURN_CHAR"
_bind "$git_commit_all_with_ci_skip_keys" " \033[1~ GIT_COMMIT_MSG_SUFFIX='[ci skip]' git_commit_all ""$RETURN_CHAR"
else
_bind "$git_commit_all_keys" "\" git_commit_all$RETURN_CHAR\""
_bind "$git_add_and_commit_keys" "\"\C-A git_add_and_commit $RETURN_CHAR\""
_bind "$git_commit_all_with_ci_skip_keys" "\"\C-A APPEND='[ci skip]' git_commit_all $RETURN_CHAR\""
_bind "$git_commit_all_with_ci_skip_keys" "\"\C-A GIT_COMMIT_MSG_SUFFIX='[ci skip]' git_commit_all $RETURN_CHAR\""
fi
fi