From 548b2e567f37690fd9def4503060ecfa3ae3021a Mon Sep 17 00:00:00 2001 From: Phil Jackson Date: Thu, 2 Sep 2010 00:00:42 +0100 Subject: [PATCH] Separation of fetch and remote update. --- magit-key-mode.el | 7 ++++++- magit.el | 17 ++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/magit-key-mode.el b/magit-key-mode.el index ff000997..a1b4cae7 100644 --- a/magit-key-mode.el +++ b/magit-key-mode.el @@ -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)) diff --git a/magit.el b/magit.el index 683e803b..bc0fa3d5 100644 --- a/magit.el +++ b/magit.el @@ -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."