diff --git a/packages/minmo.el b/packages/minmo.el index 273a1ea..3283b8c 100644 --- a/packages/minmo.el +++ b/packages/minmo.el @@ -114,7 +114,7 @@ filesystem FSTYPE, 'git or 'disk." (or minmo--git-status-cache " ")) (defvar minmo--git-directory-table (make-hash-table :test 'equal) - "Store known directories with .git") + "Store known directories with and without a ruling .git") (defun minmo--find-git (file &optional force) "Walk up the directory tree looking for `.git'. Returns the path or nil. @@ -122,8 +122,9 @@ Optional FORCE means ignore the minmo--git-directory-table." (let* ((dir (file-name-directory file)) (hash (gethash dir minmo--git-directory-table))) (if (or force (not hash)) - ;; NOTE: store 'ignore for files not under .git + ;; NOTE: store 'ignore for files not under .git, so these calls are also optimized: (puthash dir (or (locate-dominating-file file ".git") 'ignore) minmo--git-directory-table) + ;; but return nil when 'ignore, so that this function serves as a guard: (if (eq hash 'ignore) nil hash)))) (defun minmo--file-exists-locally-p ()