[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 733cdeabfb: Don't use diff-mode buffer as a patch when it's vis
From: |
Juri Linkov |
Subject: |
emacs-29 733cdeabfb: Don't use diff-mode buffer as a patch when it's visiting a file (bug#59962) |
Date: |
Sun, 11 Dec 2022 12:31:31 -0500 (EST) |
branch: emacs-29
commit 733cdeabfb91520584ab88253292c1451f295bae
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>
Don't use diff-mode buffer as a patch when it's visiting a file (bug#59962)
* lisp/vc/vc.el (vc-deduce-fileset-1): Don't call diff-vc-deduce-fileset
for diff-mode when buffer-file-name is non-nil. This is because in this
case
a file with a diff might be committed to VCS. So don't use it as a patch
to commit with 'C-x v v'.
---
lisp/vc/vc.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 328d33040d..690c907c77 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1135,7 +1135,7 @@ BEWARE: this function may change the current buffer."
(vc-dir-deduce-fileset state-model-only-files))
((derived-mode-p 'dired-mode)
(dired-vc-deduce-fileset state-model-only-files not-state-changing))
- ((derived-mode-p 'diff-mode)
+ ((and (derived-mode-p 'diff-mode) (not buffer-file-name))
(diff-vc-deduce-fileset))
((setq backend (vc-backend buffer-file-name))
(if state-model-only-files
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-29 733cdeabfb: Don't use diff-mode buffer as a patch when it's visiting a file (bug#59962),
Juri Linkov <=