aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2016-06-19 22:08:21 +0300
committerDmitry Gutov2016-06-19 22:08:21 +0300
commitdd39c6fbeb299f0b203f01388e83f5e02767b8ff (patch)
treece4ad52134d6bf28a2faf03c3d55470d113dd8cc
parent2ede29575fa22eb7c265117d7511cff9fe02c606 (diff)
downloademacs-dd39c6fbeb299f0b203f01388e83f5e02767b8ff.tar.gz
emacs-dd39c6fbeb299f0b203f01388e83f5e02767b8ff.zip
ASCII-fy coding-system-for-read used for Git commands
* lisp/vc/vc-git.el (vc-git--asciify-coding-system): New function. (vc-git-diff, vc-git-annotate-command): Use it.
-rw-r--r--lisp/vc/vc-git.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 16cbeef57ea..783ea89c6ce 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1084,6 +1084,13 @@ or BRANCH^ (where \"^\" can be repeated)."
1084 (cons 'vc-git-region-history-font-lock-keywords 1084 (cons 'vc-git-region-history-font-lock-keywords
1085 (cdr font-lock-defaults)))) 1085 (cdr font-lock-defaults))))
1086 1086
1087(defun vc-git--asciify-coding-system ()
1088 ;; Try to reconcile the content encoding with the encoding of Git's
1089 ;; auxiliary output (which is ASCII or ASCII-compatible), bug#23595.
1090 (unless (let ((samp "Binary files differ"))
1091 (string-equal samp (decode-coding-string
1092 samp coding-system-for-read t)))
1093 (setq coding-system-for-read 'undecided)))
1087 1094
1088(autoload 'vc-switches "vc") 1095(autoload 'vc-switches "vc")
1089 1096
@@ -1091,6 +1098,7 @@ or BRANCH^ (where \"^\" can be repeated)."
1091 "Get a difference report using Git between two revisions of FILES." 1098 "Get a difference report using Git between two revisions of FILES."
1092 (let (process-file-side-effects 1099 (let (process-file-side-effects
1093 (command "diff-tree")) 1100 (command "diff-tree"))
1101 (vc-git--asciify-coding-system)
1094 (if rev2 1102 (if rev2
1095 ;; Diffing against the empty tree. 1103 ;; Diffing against the empty tree.
1096 (unless rev1 (setq rev1 "4b825dc642cb6eb9a060e54bf8d69288fbee4904")) 1104 (unless rev1 (setq rev1 "4b825dc642cb6eb9a060e54bf8d69288fbee4904"))
@@ -1129,6 +1137,7 @@ or BRANCH^ (where \"^\" can be repeated)."
1129 table)) 1137 table))
1130 1138
1131(defun vc-git-annotate-command (file buf &optional rev) 1139(defun vc-git-annotate-command (file buf &optional rev)
1140 (vc-git--asciify-coding-system)
1132 (let ((name (file-relative-name file))) 1141 (let ((name (file-relative-name file)))
1133 (apply #'vc-git-command buf 'async nil "blame" "--date=short" 1142 (apply #'vc-git-command buf 'async nil "blame" "--date=short"
1134 (append (vc-switches 'git 'annotate) 1143 (append (vc-switches 'git 'annotate)