Don't run shell for magit-file-lines.
* magit.el (magit-file-lines): Read contents into temporary buffer and split into lines using split-string.
This commit is contained in:
parent
67a0c1ada7
commit
2fcdd916b9
1 changed files with 7 additions and 3 deletions
10
magit.el
10
magit.el
|
@ -255,9 +255,13 @@ Many Magit faces inherit from this one by default."
|
||||||
(magit-format-git-command fmt args)))
|
(magit-format-git-command fmt args)))
|
||||||
|
|
||||||
(defun magit-file-lines (file)
|
(defun magit-file-lines (file)
|
||||||
(if (file-exists-p file)
|
(when (file-exists-p file)
|
||||||
(magit-shell-lines (magit-format-shell-command "cat %s" (list file)))
|
(with-temp-buffer
|
||||||
nil))
|
(insert-file-contents file)
|
||||||
|
(let ((rev (nreverse (split-string (buffer-string) "\n"))))
|
||||||
|
(nreverse (if (equal (car rev) "")
|
||||||
|
(cdr rev)
|
||||||
|
rev))))))
|
||||||
|
|
||||||
(defun magit-concat-with-delim (delim seqs)
|
(defun magit-concat-with-delim (delim seqs)
|
||||||
(cond ((null seqs)
|
(cond ((null seqs)
|
||||||
|
|
Loading…
Add table
Reference in a new issue