From 3e98c9864eee740fcb51ca8900538144576d2f28 Mon Sep 17 00:00:00 2001 From: Daniel Weschke Date: Mon, 1 Feb 2021 12:17:02 +0100 Subject: [PATCH] fix fetch before counting diffs --- lisp/my/my.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/my/my.el b/lisp/my/my.el index 98193952..4e4869eb 100644 --- a/lisp/my/my.el +++ b/lisp/my/my.el @@ -424,9 +424,9 @@ Usage: (remotes (magit-list-remotes)) (diff)) (when (= (length remotes) 1) + (when with-update (magit-git-string "fetch" (car remotes) branch)) (let* ((remote-branch-name (concat (car remotes) "/" branch)) ;; @{u} may not configured, TODO: (if (magit-rev-parse "@{u}") ...) (diff-count (magit-rev-diff-count "@" remote-branch-name))) ;; i.e. git rev-list @...origin/master --count --left-right - (when with-update (magit-git-string "fetch" (car remotes) branch)) (setq diff (- (cadr diff-count) (car diff-count))))) (if as-text (if (= diff 0) "Up-to-date"