]> git.eshelyaron.com Git - emacs.git/commitdiff
project--vc-list-files: Use vc-git-command for better error reporting
authorDmitry Gutov <dmitry@gutov.dev>
Sun, 5 May 2024 17:19:48 +0000 (20:19 +0300)
committerEshel Yaron <me@eshelyaron.com>
Mon, 6 May 2024 16:55:49 +0000 (18:55 +0200)
* lisp/progmodes/project.el (project--vc-list-files):
Use 'vc-git-command' for better error reporting
(https://lists.gnu.org/archive/html/emacs-devel/2024-05/msg00399.html).

(cherry picked from commit 8d3e4e823f21d5a70f7e6c51e161b2322f1bccc3)

lisp/progmodes/project.el

index c647a542a92a31181204995ff8b8afdd8ae9b785..c89f72163759388fd59914acd21867600845a7ba 100644 (file)
@@ -643,7 +643,7 @@ See `project-vc-extra-root-markers' for the marker value format.")
        (list (project-root project)))))
 
 (declare-function vc-git--program-version "vc-git")
-(declare-function vc-git--run-command-string "vc-git")
+(declare-function vc-git-command "vc-git")
 (declare-function vc-hg-command "vc-hg")
 
 (defun project--vc-list-files (dir backend extra-ignores)
@@ -696,7 +696,8 @@ See `project-vc-extra-root-markers' for the marker value format.")
                             file
                           (concat default-directory file))))
                     (split-string
-                     (apply #'vc-git--run-command-string nil "ls-files" args)
+                     (with-output-to-string
+                       (apply #'vc-git-command standard-output 0 nil "ls-files" args))
                      "\0" t))))
        (when (project--vc-merge-submodules-p default-directory)
          ;; Unfortunately, 'ls-files --recurse-submodules' conflicts with '-o'.