summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/vc/vc.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index f08e562efe5..0a2169534e5 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1433,8 +1433,9 @@ Argument BACKEND is the backend you are using."
(lambda (str)
;; Commented or empty lines.
(string-match-p "\\`\\(?:#\\|[ \t\r\n]*\\'\\)" str))
- (vc--read-lines
- (vc-call-backend backend 'find-ignore-file file))))
+ (let ((file (vc-call-backend backend 'find-ignore-file file)))
+ (and (file-exists-p file)
+ (vc--read-lines file)))))
(defun vc--read-lines (file)
"Return a list of lines of FILE."