]> git.ipfire.org Git - thirdparty/git.git/commitdiff
dir: add a usage note to exclude_per_dir
authorElijah Newren <newren@gmail.com>
Mon, 27 Feb 2023 15:28:11 +0000 (15:28 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Feb 2023 16:29:50 +0000 (08:29 -0800)
As evidenced by the fix a couple commits ago, places in the code using
exclude_per_dir are likely buggy and should be adapted to call
setup_standard_excludes() instead.  Unfortunately, the usage of
exclude_per_dir has been hardcoded into the arguments ls-files accepts,
so we cannot actually remove it.  Add a note that it is deprecated and
no other callers should use it directly.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dir.h

diff --git a/dir.h b/dir.h
index 33fd848fc8d53b15a421343b5f96d78b89979411..2196e12630c527cd43f8cd471013fcf63eb7f375 100644 (file)
--- a/dir.h
+++ b/dir.h
@@ -295,8 +295,12 @@ struct dir_struct {
        struct untracked_cache *untracked;
 
        /**
-        * The name of the file to be read in each directory for excluded files
-        * (typically `.gitignore`).
+        * Deprecated: ls-files is the only allowed caller; all other callers
+        * should leave this as NULL; it pre-dated the
+        * setup_standard_excludes() mechanism that replaces this.
+        *
+        * This field tracks the name of the file to be read in each directory
+        * for excluded files (typically `.gitignore`).
         */
        const char *exclude_per_dir;