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:
Marius Vollmer 2009-03-01 20:57:24 +02:00
parent 67a0c1ada7
commit 2fcdd916b9

View file

@ -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)