summaryrefslogtreecommitdiff
path: root/lisp/vc/vc-git.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2011-01-29 16:19:21 -0500
committerChong Yidong <cyd@stupidchicken.com>2011-01-29 16:19:21 -0500
commita2b6e5d60b10c6baa3fbc36bfb158342c1c424ab (patch)
tree408b3a15fdee9f1443aa155efeef376df69e12de /lisp/vc/vc-git.el
parentb6bcd04894c08ef2ec8ad7569f028fc85793f8a6 (diff)
downloademacs-a2b6e5d60b10c6baa3fbc36bfb158342c1c424ab.tar.gz
Refresh Dired and VC-dir buffers after vc-pull and vc-merge.
* vc/vc-dispatcher.el (vc-set-async-update): New function for updating Dired or VC-dir buffers after async command completes. * vc/vc-bzr.el (vc-bzr-async-command): Return the process buffer. (vc-bzr-pull, vc-bzr-merge-branch): Use vc-set-async-update. * vc/vc-git.el (vc-git-merge-branch): Add FETCH_HEAD to branch completions if it exists. Use vc-set-async-update. (vc-git-pull): Use vc-set-async-update. * vc/vc-hg.el (vc-hg-pull): Fix default-contents arg to read-shell-command. Use vc-set-async-update. (vc-hg-merge-branch): Use vc-set-async-update.
Diffstat (limited to 'lisp/vc/vc-git.el')
-rw-r--r--lisp/vc/vc-git.el22
1 files changed, 15 insertions, 7 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 592fc77e2e3..de729c969ae 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -607,9 +607,8 @@ The car of the list is the current branch."
(defun vc-git-pull (prompt)
"Pull changes into the current Git branch.
-Normally, this runs \"git pull\".If there is no default
-location from which to pull or update, or if PROMPT is non-nil,
-prompt for the Git command to run."
+Normally, this runs \"git pull\". If PROMPT is non-nil, prompt
+for the Git command to run."
(let* ((root (vc-git-root default-directory))
(buffer (format "*vc-git : %s*" (expand-file-name root)))
(command "pull")
@@ -618,14 +617,15 @@ prompt for the Git command to run."
;; If necessary, prompt for the exact command.
(when prompt
(setq args (split-string
- (read-shell-command "Run Git (like this): "
+ (read-shell-command "Git pull command: "
"git pull"
'vc-git-history)
" " t))
(setq git-program (car args)
command (cadr args)
args (cddr args)))
- (apply 'vc-do-async-command buffer root git-program command args)))
+ (apply 'vc-do-async-command buffer root git-program command args)
+ (vc-set-async-update buffer)))
(defun vc-git-merge-branch ()
"Merge changes into the current Git branch.
@@ -634,9 +634,17 @@ This prompts for a branch to merge from."
(buffer (format "*vc-git : %s*" (expand-file-name root)))
(branches (cdr (vc-git-branches)))
(merge-source
- (completing-read "Merge from branch: " branches nil t)))
+ (completing-read "Merge from branch: "
+ (if (or (member "FETCH_HEAD" branches)
+ (not (file-readable-p
+ (expand-file-name ".git/FETCH_HEAD"
+ root))))
+ branches
+ (cons "FETCH_HEAD" branches))
+ nil t)))
(apply 'vc-do-async-command buffer root "git" "merge"
- (list merge-source))))
+ (list merge-source))
+ (vc-set-async-update buffer)))
;;; HISTORY FUNCTIONS