@@ -310,21 +310,22 @@ Fall back to nil (allowing all files) if Git command fails."
310
310
(let ((git-unignored (gptel-context--get-git-unignored git-root)))
311
311
(not (member rel-path git-unignored))))))
312
312
313
- (defun gptel-context--message-git-skipped (path git-cache )
313
+ (defun gptel-context--message-git-skipped (path &optional git-cache )
314
314
" Message that PATH is skipped due to gitignore rules.
315
315
Optional GIT-CACHE is a cons of git-root directory and non-ignored
316
316
files list."
317
- (let* ((git-root (car-safe git-cache))
318
- (type (if (file-directory-p path) " directory" " file" ))
317
+ (let* ((type (if (file-directory-p path) " directory" " file" ))
319
318
(skipped-common (format " git-ignored %s " type))
320
319
(skipped (if (string= type " directory" )
321
320
(concat " files from " skipped-common)
322
321
skipped-common))
323
- (rel-path (file-relative-name path git-root))
324
- (repo (file-name-nondirectory (directory-file-name git-root)))
325
- (var (symbol-name 'gptel-context-exclude-git-ignored )))
326
- (message " Skipping %s `%s' in repo (%s ). To include git-ignored files, unset `%s' . "
327
- skipped rel-path repo var)))
322
+ (var (symbol-name 'gptel-context-exclude-git-ignored ))
323
+ (reminder (format " To include git-ignored files, unset `%s' . " var)))
324
+ (if-let* ((git-root (car-safe git-cache))
325
+ (rel-path (file-relative-name path git-root))
326
+ (repo (file-name-nondirectory (directory-file-name git-root))))
327
+ (message " Skipping %s `%s' in repo (%s ). %s " skipped rel-path repo reminder)
328
+ (message " Skipping %s `%s' . %s " skipped path reminder))))
328
329
329
330
(defun gptel-context-remove (&optional context )
330
331
" Remove the CONTEXT overlay from the contexts list.
0 commit comments