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)
committerDmitry Gutov <dmitry@gutov.dev>
Sun, 5 May 2024 17:19:48 +0000 (20:19 +0300)
* 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).

lisp/progmodes/project.el

index a318134041156e3ceb5ed0ddab912235e33a70bb..52fe4df90801ff100880f4e27d55e67e10e44ae1 100644 (file)
@@ -648,7 +648,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)
@@ -701,7 +701,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'.