emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/git-commit 86509cb09e 1/3: magit-run-git: Return exit-code


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 86509cb09e 1/3: magit-run-git: Return exit-code
Date: Sun, 28 Jul 2024 16:00:16 -0400 (EDT)

branch: elpa/git-commit
commit 86509cb09e920082f789c6b0133f306e4ea11251
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    magit-run-git: Return exit-code
    
    That is useful when a command is run for side-effects, but we
    also have to do additional work afterwards, but only on success.
    
    Now `magit-run-git' can be used in cases where previously
    `magit-run-git-async' and `set-process-sentinel' had to be used
    (which in some (most?) cases is still preferable).
---
 lisp/magit-process.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lisp/magit-process.el b/lisp/magit-process.el
index bce02aaebe..7c16b1aec4 100644
--- a/lisp/magit-process.el
+++ b/lisp/magit-process.el
@@ -389,11 +389,11 @@ as well as the current repository's status buffer are 
refreshed.
 Process output goes into a new section in the buffer returned by
 `magit-process-buffer'."
   (let ((magit--refresh-cache (list (cons 0 0))))
-    (magit-call-git args)
-    (when (member (car args) '("init" "clone"))
-      ;; Creating a new repository invalidates the cache.
-      (setq magit--refresh-cache nil))
-    (magit-refresh)))
+    (prog1 (magit-call-git args)
+      (when (member (car args) '("init" "clone"))
+        ;; Creating a new repository invalidates the cache.
+        (setq magit--refresh-cache nil))
+      (magit-refresh))))
 
 (defvar magit-pre-call-git-hook nil)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]