Replace `file-exists-p' with `file-regular-p' to ensure we're actually reading from a (symlink to a) file instead of potentially blowing up with an IO error.
Signed-off-by: Pieter Praet <[email protected]> --- magit.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/magit.el b/magit.el index fe9328f..324fcfa 100644 --- a/magit.el +++ b/magit.el @@ -1081,7 +1081,7 @@ (defun magit-split-lines (str) (defun magit-file-line (file) "Return the first line of FILE as a string." - (when (file-exists-p file) + (when (file-regular-p file) (with-temp-buffer (insert-file-contents file) (buffer-substring-no-properties (point-min) @@ -1090,7 +1090,7 @@ (defun magit-file-line (file) (defun magit-file-lines (file) "Return a list of strings containing one element per line in FILE. If the last line is empty, it's trimmed." - (when (file-exists-p file) + (when (file-regular-p file) (with-temp-buffer (insert-file-contents file) (let ((rev (nreverse (split-string (buffer-string) "\n")))) -- 1.7.11.1 -- --- You received this message because you are subscribed to the Google Groups "magit" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
