Function: magit-file-lines

magit-file-lines is a natively compiled function defined in magit-base.el.

Signature

(magit-file-lines FILE &optional KEEP-EMPTY-LINES)

Documentation

Return a list of strings containing one element per line in FILE.

Unless optional argument KEEP-EMPTY-LINES is t, trim all empty lines.

Source Code

;; Defined in /nix/store/irvbdy0zra0dn8fpd008f32x5ix6qm5v-emacs-packages-deps/share/emacs/site-lisp/elpa/magit-20261005.508/magit-base.el
(defun magit-file-lines (file &optional keep-empty-lines)
  "Return a list of strings containing one element per line in FILE.
Unless optional argument KEEP-EMPTY-LINES is t, trim all empty lines."
  (and (file-regular-p file)
       (with-temp-buffer
         (insert-file-contents file)
         (split-string (buffer-string) "\n" (not keep-empty-lines)))))