diff options
| author | Jan D <jan.h.d@swipnet.se> | 2015-04-26 13:55:01 +0200 |
|---|---|---|
| committer | Jan D <jan.h.d@swipnet.se> | 2015-04-26 13:55:01 +0200 |
| commit | f92ac2e82ed199d6f25d2a59508e08addb1150ac (patch) | |
| tree | d7d7756e3dbce10d8f73c27815d815499f78c2bd /lisp/vc/vc-git.el | |
| parent | 5a094119ce79723108abd90a1fcc33721e964823 (diff) | |
| parent | a40869789fc5502e3d4e393b7c31d78cb7f29aa1 (diff) | |
| download | emacs-f92ac2e82ed199d6f25d2a59508e08addb1150ac.tar.gz | |
Merge branch 'master' into cairo
Diffstat (limited to 'lisp/vc/vc-git.el')
| -rw-r--r-- | lisp/vc/vc-git.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 48e22c82647..c8b696a03bb 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -771,6 +771,9 @@ This prompts for a branch to merge from." (vc-git--run-command-string directory "status" "--porcelain" "--")) (lines (when status (split-string status "\n" 'omit-nulls))) files) + ;; TODO: Look into reimplementing `vc-git-state', as well as + ;; `vc-git-dir-status-files', based on this output, thus making the + ;; extra process call in `vc-git-find-file-hook' unnecessary. (dolist (line lines files) (when (string-match "\\([ MADRCU?!][ MADRCU?!]\\) \\(.+\\)\\(?: -> \\(.+\\)\\)?" line) @@ -786,7 +789,12 @@ This prompts for a branch to merge from." (save-excursion (goto-char (point-min)) (unless (re-search-forward "^<<<<<<< " nil t) - (vc-git-command nil 0 buffer-file-name "add") + (if (file-exists-p (expand-file-name ".git/MERGE_HEAD" + (vc-git-root buffer-file-name))) + ;; Doing a merge. + (vc-git-command nil 0 buffer-file-name "add") + ;; Doing something else. Likely applying a stash (bug#20292). + (vc-git-command nil 0 buffer-file-name "reset")) ;; Remove the hook so that it is not called multiple times. (remove-hook 'after-save-hook 'vc-git-resolve-when-done t)))) |
