Function: vc-git-resolve-when-done

vc-git-resolve-when-done is a byte-compiled function defined in vc-git.el.gz.

Signature

(vc-git-resolve-when-done)

Documentation

Call "git add" if the conflict markers have been removed.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-git.el.gz
(defun vc-git-resolve-when-done ()
  "Call \"git add\" if the conflict markers have been removed."
  (save-excursion
    (goto-char (point-min))
    (unless (re-search-forward "^<<<<<<< " nil t)
      (vc-git-command nil 0 buffer-file-name "add")
      (unless (or
               (not (eq vc-git-resolve-conflicts 'unstage-maybe))
               ;; Doing a merge or rebase-like operation, so bug#20292
               ;; doesn't apply.
               ;;
               ;; If we were to 'git reset' in the middle of a
               ;; cherry-pick, for example, it would effectively abort
               ;; the cherry-pick, losing the user's progress.
               (cl-intersection '(merge rebase am revert cherry-pick)
                                (vc-git--cmds-in-progress))
               (vc-git-conflicted-files (vc-git-root buffer-file-name)))
        (vc-git-command nil 0 nil "reset"))
      (vc-resynch-buffer buffer-file-name t t)
      ;; Remove the hook so that it is not called multiple times.
      (remove-hook 'after-save-hook #'vc-git-resolve-when-done t))))