diff options
| author | Dmitry Gutov | 2021-07-22 14:41:52 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-07-22 14:41:52 +0200 |
| commit | a2d0ff26005c5c10ffe0d84bd8b458a06828be82 (patch) | |
| tree | 4eb652fb61ceb8d704fbef016996bdfe8f840724 | |
| parent | 6f9ff3d7493d144af182ddd6fcf512f98b78ad0c (diff) | |
| download | emacs-a2d0ff26005c5c10ffe0d84bd8b458a06828be82.tar.gz emacs-a2d0ff26005c5c10ffe0d84bd8b458a06828be82.zip | |
Bind the GIT_LITERAL_PATHSPECS environment variable
* lisp/vc/vc-git.el (vc-git-command):
(vc-git--call): Ensure that git interprets file names literally
(bug#39452).
| -rw-r--r-- | etc/NEWS | 6 | ||||
| -rw-r--r-- | lisp/vc/vc-git.el | 2 |
2 files changed, 8 insertions, 0 deletions
| @@ -886,6 +886,12 @@ keys, add the following to your init file: | |||
| 886 | 886 | ||
| 887 | ** Change Logs and VC | 887 | ** Change Logs and VC |
| 888 | 888 | ||
| 889 | *** vc-git now sets the GIT_LITERAL_PATHSPECS environment variable. | ||
| 890 | This ensures that Git operations on files containing wildcard | ||
| 891 | characters work as they're supposed to. However, this also affects | ||
| 892 | scripts running from Git hooks, and these have to "unset | ||
| 893 | GIT_LITERAL_PATHSPECS" to work as before. | ||
| 894 | |||
| 889 | *** More VC commands can be used from non-file buffers. | 895 | *** More VC commands can be used from non-file buffers. |
| 890 | The relevant commands are those that don't change the VC state. | 896 | The relevant commands are those that don't change the VC state. |
| 891 | The non-file buffers which can use VC commands are those that have | 897 | The non-file buffers which can use VC commands are those that have |
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 5828a83debc..143087122fd 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el | |||
| @@ -1772,6 +1772,7 @@ The difference to vc-do-command is that this function always invokes | |||
| 1772 | (process-environment | 1772 | (process-environment |
| 1773 | (append | 1773 | (append |
| 1774 | `("GIT_DIR" | 1774 | `("GIT_DIR" |
| 1775 | "GIT_LITERAL_PATHSPECS=1" | ||
| 1775 | ;; Avoid repository locking during background operations | 1776 | ;; Avoid repository locking during background operations |
| 1776 | ;; (bug#21559). | 1777 | ;; (bug#21559). |
| 1777 | ,@(when revert-buffer-in-progress-p | 1778 | ,@(when revert-buffer-in-progress-p |
| @@ -1806,6 +1807,7 @@ The difference to vc-do-command is that this function always invokes | |||
| 1806 | (process-environment | 1807 | (process-environment |
| 1807 | (append | 1808 | (append |
| 1808 | `("GIT_DIR" | 1809 | `("GIT_DIR" |
| 1810 | "GIT_LITERAL_PATHSPECS=1" | ||
| 1809 | ;; Avoid repository locking during background operations | 1811 | ;; Avoid repository locking during background operations |
| 1810 | ;; (bug#21559). | 1812 | ;; (bug#21559). |
| 1811 | ,@(when revert-buffer-in-progress-p | 1813 | ,@(when revert-buffer-in-progress-p |