From 8d4f32902dbf19f3fed181ab845c554dcfaf0444 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 9 Sep 2026 14:44:16 +0300 Subject: [PATCH] Revert "VC-Git: Pass --no-optional-locks" This reverts commit bc92224c5f163f94f80b29dae744a488dd675e0a. * lisp/vc/vc-git.el (vc-git--no-optional-locks): Remove the function and adjust all callers. It turns out the command line option '--no-optional-locks' is also supported since the same Git version 2.15 as the environment variable, and in older versions it fails Git, unlike the environment variable which is just ignored. (Bug#81814) --- lisp/vc/vc-git.el | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 34b10dedf96..17c358e25d5 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -2899,13 +2899,6 @@ page for the meanings of these attributes." (equal subcommand "status")) '("GIT_OPTIONAL_LOCKS=0")))) -;; This is for the same purpose as `vc-git--env-vars' except that it -;; covers older Git, which doesn't recognise the environment variable. -(defun vc-git--no-optional-locks (subcommand) - (and (or revert-buffer-in-progress - (equal subcommand "status")) - '("--no-optional-locks"))) - (defun vc-git-command (buffer okstatus file-or-list &rest flags) "A wrapper around `vc-do-command' for use in vc-git.el. The difference to `vc-do-command' is that this function always invokes @@ -2951,9 +2944,7 @@ The difference to `vc-do-command' is that this function always invokes ".") ((not file-list-is-rootdir) file-or-list)) - (cons "--no-pager" - (append (vc-git--no-optional-locks (car flags)) - flags))))) + (cons "--no-pager" flags)))) (defun vc-git--empty-db-p () "Check if the git db is empty (no commit done yet)." @@ -2973,9 +2964,7 @@ The difference to `vc-do-command' is that this function always invokes (process-environment (append (vc-git--env-vars command) process-environment))) (apply #'process-file vc-git-program infile buffer nil - (cons "--no-pager" - (append (vc-git--no-optional-locks command) - (cons command args)))))) + "--no-pager" command args))) (defun vc-git--out-ok (command &rest args) "Run `git COMMAND ARGS...' and insert standard output in current buffer.