aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2015-04-19 22:24:39 +0300
committerDmitry Gutov2015-04-19 22:24:39 +0300
commitb5b0e0500eb6fac1b0b2e9ca4da08826225b010b (patch)
tree4160097f23b194704a6fc7efdaceb238837ef155
parentf5076daca0c640cd53b2fb71ab693db3c83ad020 (diff)
downloademacs-b5b0e0500eb6fac1b0b2e9ca4da08826225b010b.tar.gz
emacs-b5b0e0500eb6fac1b0b2e9ca4da08826225b010b.zip
Call `smerge-start-session' even when dealing with a stash conflict
* lisp/vc/vc-git.el (vc-git-find-file-hook): Call `smerge-start-session' even when dealing with a stash conflict (bug#20292).
-rw-r--r--lisp/vc/vc-git.el35
1 files changed, 20 insertions, 15 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 8f7015e0c5f..bec36fd3e98 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -792,21 +792,26 @@ This prompts for a branch to merge from."
792 792
793(defun vc-git-find-file-hook () 793(defun vc-git-find-file-hook ()
794 "Activate `smerge-mode' if there is a conflict." 794 "Activate `smerge-mode' if there is a conflict."
795 (when (and buffer-file-name 795 (let (stashed)
796 ;; FIXME 796 (when (and buffer-file-name
797 ;; 1) the net result is to call git twice per file. 797 ;; FIXME
798 ;; 2) v-g-c-f is documented to take a directory. 798 ;; 1) the net result is to call git twice per file.
799 ;; http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01126.html 799 ;; 2) v-g-c-f is documented to take a directory.
800 (vc-git-conflicted-files buffer-file-name) 800 ;; http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01126.html
801 (save-excursion 801 ;; XXX: Should we first look for the markers, and only
802 (goto-char (point-min)) 802 ;; call this function when see some?
803 (and (re-search-forward "^>>>>>>> " nil 'noerror) 803 (vc-git-conflicted-files buffer-file-name)
804 ;; Stashes are tricky (bug#20292). 804 (save-excursion
805 (not (looking-at "Stashed changes"))))) 805 (goto-char (point-min))
806 (vc-file-setprop buffer-file-name 'vc-state 'conflict) 806 (when (re-search-forward "^>>>>>>> " nil 'noerror)
807 (smerge-start-session) 807 (setq stashed (looking-at "Stashed changes"))
808 (add-hook 'after-save-hook 'vc-git-resolve-when-done nil 'local) 808 t)))
809 (message "There are unresolved conflicts in this file"))) 809 (vc-file-setprop buffer-file-name 'vc-state 'conflict)
810 (smerge-start-session)
811 (unless stashed
812 ;; Stashes are tricky (bug#20292).
813 (add-hook 'after-save-hook 'vc-git-resolve-when-done nil 'local))
814 (message "There are unresolved conflicts in this file"))))
810 815
811;;; HISTORY FUNCTIONS 816;;; HISTORY FUNCTIONS
812 817