Skip to content

Commit 03cebac

Browse files
committed
gptel-context: Rename gptel-context--is-git-ignored-p
I thought calling this function ‘gptel-context--is-git-ignored-p’ would make its purpose clear, but I now realize this is a misnomer: the value returned depends also on the user option gptel-context-exclude-git-ignored, so the function may return nil even when the file is git-ignored.
1 parent 9b5a630 commit 03cebac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gptel-context.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ the `.gitignore' file of their associated repository."
144144
((and (derived-mode-p 'image-mode)
145145
(gptel--model-capable-p 'media)
146146
(buffer-file-name)
147-
(not (gptel-context--is-git-ignored-p (buffer-file-name))))
147+
(not (gptel-context--git-skip-p (buffer-file-name))))
148148
(funcall (if (and arg (< (prefix-numeric-value arg) 0))
149149
#'gptel-context-remove
150150
#'gptel-context-add-file)
@@ -270,7 +270,7 @@ files list."
270270
(file-in-directory-p path git-root)
271271
(not (member (file-relative-name path git-root) tracked-files))))
272272
;; Otherwise check individually
273-
(gptel-context--is-git-ignored-p path)))
273+
(gptel-context--git-skip-p path)))
274274
(gptel-context--message-git-skipped path git-cache))
275275
((gptel--file-binary-p path)
276276
(gptel-context--add-binary-file path))
@@ -301,7 +301,7 @@ Fall back to nil (allowing all files) if Git command fails."
301301
;; Return nil to allow all files rather than exclude all
302302
nil))))
303303

304-
(defun gptel-context--is-git-ignored-p (file)
304+
(defun gptel-context--git-skip-p (file)
305305
"Return non-nil if FILE should be skipped due to gitignore rules."
306306
(when (and gptel-context-exclude-git-ignored
307307
(executable-find "git"))

0 commit comments

Comments
 (0)