commit d346ca63650d46333fb950a6c5926458949f1c94 from: Omar Polo date: Fri Jan 08 17:52:39 2021 UTC 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. commit - dcb5b83a7470b57af0f2d26f6fbe6810308b13aa commit + d346ca63650d46333fb950a6c5926458949f1c94 blob - 3dec6b932a4e9f3256893cbc1f6da8c892c07549 blob + a38a5da922a31fdf7bbf43722aafaf6c89799fca --- vc-got.el +++ 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."