Separation of fetch and remote update.

This commit is contained in:
Phil Jackson 2010-09-02 00:00:42 +01:00
parent a3f38d4111
commit 548b2e567f
2 changed files with 14 additions and 10 deletions

View file

@ -31,7 +31,7 @@
(define-key map (kbd "t") (lambda () (interactive) (magit-key-mode 'tagging)))
(define-key map (kbd "r") (lambda () (interactive) (magit-key-mode 'rewriting)))
(define-key map (kbd "P") (lambda () (interactive) (magit-key-mode 'pushing)))
(define-key map (kbd "f") 'magit-remote-update)
(define-key map (kbd "f") (lambda () (interactive) (magit-key-mode 'fetching)))
(define-key map (kbd "b") (lambda () (interactive) (magit-key-mode 'branching)))
(define-key map (kbd "F") (lambda () (interactive) (magit-key-mode 'pulling)))
(define-key map (kbd "c") 'magit-log-edit)
@ -168,6 +168,11 @@
("=a" "Author" "--author" read-from-minibuffer)
("=g" "Grep" "--grep" read-from-minibuffer)))
(fetching
(actions
("f" "Fetch" magit-fetch)
("r" "Remote update" magit-remote-update)))
(pushing
(actions
("p" "Push" magit-push))

View file

@ -2902,16 +2902,15 @@ Uncomitted changes in both working tree and staging area are lost.
;;; Updating, pull, and push
(magit-define-command remote-update (&optional remote)
"Update REMOTE. If nil, update all remotes.
(magit-define-command fetch ()
"Run fetch."
(interactive)
(magit-run-git-async "fetch" (magit-read-remote)))
When called interactively, update the current remote unless a
prefix arg is given. With prefix arg, prompt for a remote and
update it."
(interactive (list (when current-prefix-arg (magit-read-remote))))
(cond
(remote (magit-run-git-async "fetch" remote))
(t (magit-run-git-async "remote" "update"))))
(magit-define-command remote-update ()
"Update all remotes."
(interactive)
(magit-run-git-async "remote" "update"))
(magit-define-command pull ()
"Run git pull against the current remote."