summaryrefslogtreecommitdiff
path: root/lisp/vc/vc-git.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2018-09-29 12:40:15 +0200
committerMichael Albinus <michael.albinus@gmx.de>2018-09-29 12:40:15 +0200
commitfd369be7ebf08414f4c517c7c2e854ccb9d520bc (patch)
tree866ef83ca4c8bd1a6dff8f57649cc8f9e724ea76 /lisp/vc/vc-git.el
parent2296bf188fc99d66306e71e6decd3d2e176b7ae6 (diff)
downloademacs-fd369be7ebf08414f4c517c7c2e854ccb9d520bc.tar.gz
Finish fix for Bug#21559
* lisp/vc/vc-git.el (vc-git--call): If `revert-buffer-in-progress-p' flag is set, prepend "GIT_OPTIONAL_LOCKS=0" to "process-environment". (Bug#21559)
Diffstat (limited to 'lisp/vc/vc-git.el')
-rw-r--r--lisp/vc/vc-git.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 03afce51709..4ea7ea53442 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1628,8 +1628,15 @@ The difference to vc-do-command is that this function always invokes
(or coding-system-for-read vc-git-log-output-coding-system))
(coding-system-for-write
(or coding-system-for-write vc-git-commits-coding-system))
- (process-environment (cons "PAGER=" process-environment)))
- (push "GIT_DIR" process-environment)
+ (process-environment
+ (append
+ `("GIT_DIR"
+ "PAGER="
+ ;; Avoid repository locking during background operations
+ ;; (bug#21559).
+ ,@(when revert-buffer-in-progress-p
+ '("GIT_OPTIONAL_LOCKS=0")))
+ process-environment)))
(apply 'process-file vc-git-program nil buffer nil command args)))
(defun vc-git--out-ok (command &rest args)