diff options
| author | Alexei Khlebnikov | 2018-02-22 12:21:49 +0100 |
|---|---|---|
| committer | Michael Albinus | 2018-02-22 12:21:49 +0100 |
| commit | cb55ccae8be946f1562d74718086a4c8c8308ee5 (patch) | |
| tree | 13fa054071e21b9c50a87c73cd4a625e76a01319 | |
| parent | 130c1b8e0e94e7f309db54e440a73cb15a2c8ab6 (diff) | |
| download | emacs-cb55ccae8be946f1562d74718086a4c8c8308ee5.tar.gz emacs-cb55ccae8be946f1562d74718086a4c8c8308ee5.zip | |
Fix for: "25.0.50; auto-revert-mode breaks git rebase" (Bug#21559)
* lisp/autorevert.el (auto-revert-handler):
Set "revert-buffer-in-progress-p" flag before calling
"vc-refresh-state".
* lisp/vc/vc-git.el (vc-git-command):
If "revert-buffer-in-progress-p" flag is set, prepend
"GIT_OPTIONAL_LOCKS=0" to "process-environment". (Bug#21559)
| -rw-r--r-- | lisp/autorevert.el | 3 | ||||
| -rw-r--r-- | lisp/vc/vc-git.el | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lisp/autorevert.el b/lisp/autorevert.el index cf145e0ee38..0a9d3bef546 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el | |||
| @@ -709,7 +709,8 @@ This is an internal function used by Auto-Revert Mode." | |||
| 709 | ;; `preserve-modes' avoids changing the (minor) modes. But we do | 709 | ;; `preserve-modes' avoids changing the (minor) modes. But we do |
| 710 | ;; want to reset the mode for VC, so we do it manually. | 710 | ;; want to reset the mode for VC, so we do it manually. |
| 711 | (when (or revert auto-revert-check-vc-info) | 711 | (when (or revert auto-revert-check-vc-info) |
| 712 | (vc-refresh-state)))) | 712 | (let ((revert-buffer-in-progress-p t)) |
| 713 | (vc-refresh-state))))) | ||
| 713 | 714 | ||
| 714 | (defun auto-revert-tail-handler (size) | 715 | (defun auto-revert-tail-handler (size) |
| 715 | (let ((modified (buffer-modified-p)) | 716 | (let ((modified (buffer-modified-p)) |
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 26af99805d0..163333af3ba 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el | |||
| @@ -1569,7 +1569,14 @@ The difference to vc-do-command is that this function always invokes | |||
| 1569 | (or coding-system-for-read vc-git-log-output-coding-system)) | 1569 | (or coding-system-for-read vc-git-log-output-coding-system)) |
| 1570 | (coding-system-for-write | 1570 | (coding-system-for-write |
| 1571 | (or coding-system-for-write vc-git-commits-coding-system)) | 1571 | (or coding-system-for-write vc-git-commits-coding-system)) |
| 1572 | (process-environment (cons "GIT_DIR" process-environment))) | 1572 | (process-environment |
| 1573 | (append | ||
| 1574 | `("GIT_DIR" | ||
| 1575 | ;; Avoid repository locking during background operations | ||
| 1576 | ;; (bug#21559). | ||
| 1577 | ,@(when revert-buffer-in-progress-p | ||
| 1578 | '("GIT_OPTIONAL_LOCKS=0"))) | ||
| 1579 | process-environment))) | ||
| 1573 | (apply 'vc-do-command (or buffer "*vc*") okstatus vc-git-program | 1580 | (apply 'vc-do-command (or buffer "*vc*") okstatus vc-git-program |
| 1574 | ;; https://debbugs.gnu.org/16897 | 1581 | ;; https://debbugs.gnu.org/16897 |
| 1575 | (unless (and (not (cdr-safe file-or-list)) | 1582 | (unless (and (not (cdr-safe file-or-list)) |