summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2019-02-08 08:59:23 +0200
committerEli Zaretskii <eliz@gnu.org>2019-02-08 08:59:23 +0200
commit459b669b08d235a79ff4fa61b2d93e9a6229facd (patch)
tree5d856c6522a9a23b5075262b30a077fbac15ef89
parente9ff19053139c149460fa8b1214c4012fc11cd0d (diff)
downloademacs-459b669b08d235a79ff4fa61b2d93e9a6229facd.tar.gz
Fix failures of vc-find-revision with non-ASCII file names
* lisp/vc/vc.el (vc-find-revision): Instead of binding coding-system-for-write, make the buffer-file-coding-system of the temporary buffer be no-conversion. This avoids the unwanted side effect of not encoding the command-line arguments of the VCS commands invoked by the backend. (Bug#34350)
-rw-r--r--lisp/vc/vc.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 9925196f737..326284f4446 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1966,10 +1966,13 @@ Use BACKEND as the VC backend if specified."
(with-current-buffer filebuf
(let ((failed t))
(unwind-protect
- (let ((coding-system-for-read 'no-conversion)
- (coding-system-for-write 'no-conversion))
+ (let ((coding-system-for-read 'no-conversion))
(with-temp-file filename
(let ((outbuf (current-buffer)))
+ ;; We will read the backend's output with no
+ ;; conversions, so we should also save the
+ ;; temporary file with no encoding conversions.
+ (setq buffer-file-coding-system 'no-conversion)
;; Change buffer to get local value of
;; vc-checkout-switches.
(with-current-buffer filebuf