emacs-diffs
[Top][All Lists]
Advanced

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

master 77fb8a1612: vc-git--pushpull: Restore handling of vc-git-program


From: Sean Whitton
Subject: master 77fb8a1612: vc-git--pushpull: Restore handling of vc-git-program
Date: Fri, 23 Sep 2022 22:13:57 -0400 (EDT)

branch: master
commit 77fb8a16120a03227a8851ef23bb0293f6a11d2d
Author: Sean Whitton <spwhitton@spwhitton.name>
Commit: Sean Whitton <spwhitton@spwhitton.name>

    vc-git--pushpull: Restore handling of vc-git-program
    
    * lisp/vc/vc-git.el (vc-git--pushpull): Restore handling of
    vc-git-program before recent change: respect a buffer-local value of
    vc-git-program, and don't ignore user edits to the git program name
    when PROMPT.
---
 lisp/vc/vc-git.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 2228cf8665..3816d323e6 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1096,22 +1096,25 @@ It is based on `log-edit-mode', and has Git-specific 
extensions."
 If PROMPT is non-nil, prompt for the Git command to run."
   (let* ((root (vc-git-root default-directory))
         (buffer (format "*vc-git : %s*" (expand-file-name root)))
+         (git-program vc-git-program)
          ;; TODO if pushing, prompt if no default push location - cf bzr.
          (vc-want-edit-command-p prompt))
     (require 'vc-dispatcher)
     (when vc-want-edit-command-p
       (with-current-buffer (get-buffer-create buffer)
         (add-hook 'vc-pre-command-functions
-                  (pcase-lambda (_ _ `(,new-command . ,new-args))
-                    (setq command new-command extra-args new-args))
+                  (lambda (&rest args)
+                    (setq git-program (car args)
+                          command (caaddr args)
+                          extra-args (cdaddr args)))
                   nil t)))
     (apply #'vc-do-async-command
-           buffer root vc-git-program command extra-args)
+           buffer root git-program command extra-args)
     (with-current-buffer buffer
       (vc-run-delayed
         (vc-compilation-mode 'git)
         (setq-local compile-command
-                    (concat vc-git-program " " command " "
+                    (concat git-program " " command " "
                             (mapconcat #'identity extra-args " ")))
         (setq-local compilation-directory root)
         ;; Either set `compilation-buffer-name-function' locally to nil



reply via email to

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