;;; project.el --- Operations on the current project -*- lexical-binding: t; -*-
;; Copyright (C) 2015-2023 Free Software Foundation, Inc.
-;; Version: 0.9.5
+;; Version: 0.9.6
;; Package-Requires: ((emacs "26.1") (xref "1.4.0"))
;; This is a GNU ELPA :core package. Avoid using functionality that
dir
(lambda (d)
;; Maybe limit count to 100 when we can drop Emacs < 28.
- (setq last-matches (directory-files d nil marker-re t)))))
+ (setq last-matches
+ (condition-case nil
+ (directory-files d nil marker-re t)
+ (file-missing nil))))))
(backend
(cl-find-if
(lambda (b)
(should (equal '(".dir-locals.el" "foo")
(mapcar #'file-name-nondirectory (project-files project))))))
+(ert-deftest project-vc-nonexistent-directory-no-error ()
+ "Check that is doesn't error out when the current dir does not exist."
+ (skip-unless (eq (vc-responsible-backend default-directory) 'Git))
+ (let* ((dir (expand-file-name "foo-456/bar/" (ert-resource-directory)))
+ (_ (vc-file-clearprops dir))
+ (project-vc-extra-root-markers '(".dir-locals.el"))
+ (project (project-current nil dir)))
+ (should-not (null project))
+ (should (string-match-p "/test/lisp/progmodes/project-resources/\\'" (project-root project)))))
+
;;; project-tests.el ends here