Better indication of "git remote update" in mode line.
* magit.el (magit-process-indicator-from-command): New. (magit-run-command): Use it.
This commit is contained in:
parent
7ad6d4dd55
commit
ae5b5d4fe0
1 changed files with 12 additions and 3 deletions
15
magit.el
15
magit.el
|
@ -479,6 +479,16 @@ Many Magit faces inherit from this one by default."
|
||||||
(concat " " str)
|
(concat " " str)
|
||||||
""))))
|
""))))
|
||||||
|
|
||||||
|
(defun magit-process-indicator-from-command (cmd args)
|
||||||
|
(cond ((or (null args)
|
||||||
|
(not (equal cmd "git")))
|
||||||
|
cmd)
|
||||||
|
((or (null (cdr args))
|
||||||
|
(not (member (car args) '("remote"))))
|
||||||
|
(car args))
|
||||||
|
(t
|
||||||
|
(concat (car args) " " (cadr args)))))
|
||||||
|
|
||||||
(defvar magit-process nil)
|
(defvar magit-process nil)
|
||||||
|
|
||||||
(defun magit-run-command (logline cmd &rest args)
|
(defun magit-run-command (logline cmd &rest args)
|
||||||
|
@ -486,9 +496,8 @@ Many Magit faces inherit from this one by default."
|
||||||
(error "Git is already running."))
|
(error "Git is already running."))
|
||||||
(let ((dir default-directory)
|
(let ((dir default-directory)
|
||||||
(buf (get-buffer-create "*magit-process*")))
|
(buf (get-buffer-create "*magit-process*")))
|
||||||
(magit-set-mode-line-process (if (equal cmd "git")
|
(magit-set-mode-line-process
|
||||||
(car args)
|
(magit-process-indicator-from-command cmd args))
|
||||||
cmd))
|
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(set-buffer buf)
|
(set-buffer buf)
|
||||||
(setq default-directory dir)
|
(setq default-directory dir)
|
||||||
|
|
Loading…
Add table
Reference in a new issue