branch: elpa/magit
commit 914285a5e88e34179a72422ea0fffc41d1a43815
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    No longer add global git arguments twice
    
    `magit-process-git' adds the global arguments, but in [1: fd5cf61730],
    which added that function and started using it in many places, we did
    not remove the now redundant calls to `magit-process-git-arguments'
    in some of these places, resulting in the global arguments being added
    twice.
    
    1: 2021-07-20 fd5cf61730af2051200f81741fd21e8c54f19164
       magit-process-git: New function
---
 CHANGELOG            | 3 +++
 lisp/magit-bisect.el | 3 +--
 lisp/magit-git.el    | 9 +++++----
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 7b00e23c814..4bf6a596d0a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -14,6 +14,9 @@ Bug fixes:
 - ~magit-copy-section-value~ no longer did anything for most section
   types.  #5244.
 
+- Global git arguments often got added twice to the list of arguments
+  ultimately passed to git.
+
 * v4.1.1    2024-10-01
 
 - Avoid unnecessary work when ~auto-revert-remote-files~ is ~nil~.  #5222
diff --git a/lisp/magit-bisect.el b/lisp/magit-bisect.el
index 47095de05d5..55dec389568 100644
--- a/lisp/magit-bisect.el
+++ b/lisp/magit-bisect.el
@@ -206,8 +206,7 @@ bisect run'."
     (magit-with-toplevel
       (magit-process-git
        (list :file (expand-file-name "BISECT_CMD_OUTPUT" (magit-gitdir)))
-       (magit-process-git-arguments
-        (list "bisect" "start" bad good args)))
+       "bisect" "start" bad good args)
       (magit-refresh)))
   (magit--with-connection-local-variables
     (magit-git-bisect "run" (list shell-file-name
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index b6af965102b..c66a1cd03de 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -468,7 +468,7 @@ add a section in the respective process buffer."
   (apply #'magit--git-insert nil args))
 
 (defun magit--git-insert (return-error &rest args)
-  (setq args (magit-process-git-arguments args))
+  (setq args (flatten-tree args))
   (if (or return-error magit-git-debug)
       (let (log)
         (unwind-protect
@@ -488,9 +488,10 @@ add a section in the respective process buffer."
                   (unless return-error
                     (let ((magit-git-debug nil))
                       (with-current-buffer (magit-process-buffer t)
-                        (magit-process-insert-section default-directory
-                                                      magit-git-executable
-                                                      args exit log)))))
+                        (magit-process-insert-section
+                         default-directory magit-git-executable
+                         (magit-process-git-arguments args)
+                         exit log)))))
                 (unless return-error
                   (if errmsg
                       (message "%s" errmsg)

Reply via email to