Commit 9ba9ab0b authored by Jonas Bernoulli's avatar Jonas Bernoulli

magit-wip-maybe-add-commit-hook: New function

parent b0b7bc7a
......@@ -497,11 +497,8 @@ This is only used if Magit is available."
(add-hook 'with-editor-pre-cancel-hook
'git-commit-save-message nil t)
(add-hook 'with-editor-post-finish-hook 'git-commit-run-post-finish-hook)
(when (and (bound-and-true-p magit-wip-merge-branch)
(fboundp 'magit-wip-any-enabled-p)
(add-hook 'with-editor-post-finish-hook
'magit-wip-commit nil t))
(when (fboundp 'magit-wip-maybe-add-commit-hook)
(setq with-editor-cancel-message
(make-local-variable 'log-edit-comment-ring-index)
......@@ -350,6 +350,12 @@ commit message."
(concat "refs/heads/" branch))
(defun magit-wip-maybe-add-commit-hook ()
(when (and magit-wip-merge-branch
(add-hook 'with-editor-post-finish-hook 'magit-wip-commit nil t)))
(defun magit-wip-any-enabled-p ()
(or magit-wip-mode
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment