diff options
Diffstat (limited to 'admin/gitmerge.el')
-rw-r--r-- | admin/gitmerge.el | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/admin/gitmerge.el b/admin/gitmerge.el index eddc72e679c..13d92ac92bc 100644 --- a/admin/gitmerge.el +++ b/admin/gitmerge.el @@ -316,11 +316,7 @@ Returns non-nil if conflicts remain." (gitmerge-emacs-version gitmerge--from)))) (file-exists-p temp) (or noninteractive - (and - (y-or-n-p "Try to fix NEWS conflict? ") - ;; FIXME - (y-or-n-p "This is buggy, really try? ") - ))) + (y-or-n-p "Try to fix NEWS conflict? "))) (let ((relfile (file-name-nondirectory file)) (tempfile (make-temp-file "gitmerge"))) (unwind-protect @@ -431,7 +427,9 @@ Throw an user-error if we cannot resolve automatically." (setq conflicted t) ;; Mark as resolved (call-process "git" nil t nil "add" file))) - (when conflicted + (if (not conflicted) + (and files (not (gitmerge-commit)) + (error "Error committing resolution - fix it manually")) (with-current-buffer (get-buffer-create gitmerge-warning-buffer) (erase-buffer) (insert "For the following files, conflicts could\n" @@ -457,6 +455,12 @@ Throw an user-error if we cannot resolve automatically." "diff" "--name-only") (zerop (buffer-size)))) +(defun gitmerge-commit () + "Commit, and return non-nil if it succeeds." + (with-current-buffer (get-buffer-create gitmerge-output-buffer) + (erase-buffer) + (eq 0 (call-process "git" nil t nil "commit" "--no-edit")))) + (defun gitmerge-maybe-resume () "Check if we have to resume a merge. If so, add no longer conflicted files and commit." @@ -478,11 +482,8 @@ If so, add no longer conflicted files and commit." (gitmerge-resolve-unmerged) ;; Commit the merge. (when mergehead - (with-current-buffer (get-buffer-create gitmerge-output-buffer) - (erase-buffer) - (unless (zerop (call-process "git" nil t nil - "commit" "--no-edit")) - (error "Git error during merge - fix it manually")))) + (or (gitmerge-commit) + (error "Git error during merge - fix it manually"))) ;; Successfully resumed. t)))) |