]> git.eshelyaron.com Git - emacs.git/commitdiff
Bind the GIT_LITERAL_PATHSPECS environment variable
authorDmitry Gutov <dgutov@yandex.ru>
Thu, 22 Jul 2021 12:41:52 +0000 (14:41 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 22 Jul 2021 12:41:52 +0000 (14:41 +0200)
* lisp/vc/vc-git.el (vc-git-command):
(vc-git--call): Ensure that git interprets file names literally
(bug#39452).

etc/NEWS
lisp/vc/vc-git.el

index b1db3b7c331154a7f14be23367f16a81049a05ea..bf19c34f02131b8bc1a276bc1dc3f71a24b2e044 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -886,6 +886,12 @@ keys, add the following to your init file:
 
 ** Change Logs and VC
 
+*** vc-git now sets the GIT_LITERAL_PATHSPECS environment variable.
+This ensures that Git operations on files containing wildcard
+characters work as they're supposed to.  However, this also affects
+scripts running from Git hooks, and these have to "unset
+GIT_LITERAL_PATHSPECS" to work as before.
+
 *** More VC commands can be used from non-file buffers.
 The relevant commands are those that don't change the VC state.
 The non-file buffers which can use VC commands are those that have
index 5828a83debcf0babb0b35e774f5b9edc5c2029ef..143087122fd7c00434241a52063e5a81259410a1 100644 (file)
@@ -1772,6 +1772,7 @@ The difference to vc-do-command is that this function always invokes
         (process-environment
          (append
           `("GIT_DIR"
+            "GIT_LITERAL_PATHSPECS=1"
             ;; Avoid repository locking during background operations
             ;; (bug#21559).
             ,@(when revert-buffer-in-progress-p
@@ -1806,6 +1807,7 @@ The difference to vc-do-command is that this function always invokes
        (process-environment
         (append
          `("GIT_DIR"
+            "GIT_LITERAL_PATHSPECS=1"
            ;; Avoid repository locking during background operations
            ;; (bug#21559).
            ,@(when revert-buffer-in-progress-p