branch: externals/vc-got
commit d346ca63650d46333fb950a6c5926458949f1c94
Author: Omar Polo <[email protected]>
Commit: Omar Polo <[email protected]>
ignore ignored files
closes #12
The rationale is that `got status` doesn't print the status of the
file if it is either up-to-date or ignored by .gitignore or
.cvsignore. Thus, we were marking as up-to-date the ignored files in
*vc-dir*. (vc-got-state was working as expected.)
This tries to fix the situation. File for which `got status` doesn't
print any info are saved in a double-check list, and we issue a second
`got status` only against the double check list, and push onto res
only the up-to-date ones.
---
vc-got.el | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/vc-got.el b/vc-got.el
index 3dec6b9..a38a5da 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -420,16 +420,25 @@ files on disk."
The builded result is given to the callback UPDATE-FUNCTION. If
FILES is nil, consider all the files in DIR."
(let* ((fs (vc-got--dir-filter-files (or files (directory-files dir))))
- (res (vc-got--status nil dir files)))
+ ;; XXX: we call with files, wich will probably be nil on the
+ ;; first run, so we catch deleted, missing and edited files
+ ;; in subdirectories.
+ (res (vc-got--status nil dir files))
+ double-check)
(cl-loop for file in fs
do (when (and (not (cdr (assoc file res #'string=)))
(not (file-directory-p file))
;; if file doesn't exists, it's a
;; untracked file that was removed.
(file-exists-p file))
- (push (list file 'up-to-date nil)
- res))
- finally (funcall update-function res nil))))
+ ;; if we don't know the status of a file here, it's
+ ;; either up-to-date or ignored. Save it for a
+ ;; double check
+ (push file double-check)))
+ (cl-loop for (file status _) in (vc-got--status nil dir double-check)
+ unless (eq status 'unregistered)
+ do (push (list file 'up-to-date nil) res))
+ (funcall update-function res nil)))
(defun vc-got-dir-extra-headers (dir)
"Return a string for the `vc-dir' buffer heading for directory DIR."