minmo : notes
This commit is contained in:
parent
4fe87a7660
commit
24e1030a55
1 changed files with 3 additions and 2 deletions
|
|
@ -114,7 +114,7 @@ filesystem FSTYPE, 'git or 'disk."
|
||||||
(or minmo--git-status-cache " "))
|
(or minmo--git-status-cache " "))
|
||||||
|
|
||||||
(defvar minmo--git-directory-table (make-hash-table :test 'equal)
|
(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)
|
(defun minmo--find-git (file &optional force)
|
||||||
"Walk up the directory tree looking for `.git'. Returns the path or nil.
|
"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))
|
(let* ((dir (file-name-directory file))
|
||||||
(hash (gethash dir minmo--git-directory-table)))
|
(hash (gethash dir minmo--git-directory-table)))
|
||||||
(if (or force (not hash))
|
(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)
|
(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))))
|
(if (eq hash 'ignore) nil hash))))
|
||||||
|
|
||||||
(defun minmo--file-exists-locally-p ()
|
(defun minmo--file-exists-locally-p ()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue