From 0f0503d83438ac704a995f8683537df7cd6580f4 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Sat, 23 Nov 2024 11:15:32 -0800 Subject: [PATCH] doc: Explain that require_git(false) will ascend above git roots Helps avoid confusion about #2812 --- crates/ignore/src/walk.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/ignore/src/walk.rs b/crates/ignore/src/walk.rs index d6ea9c217..4a8ecabc3 100644 --- a/crates/ignore/src/walk.rs +++ b/crates/ignore/src/walk.rs @@ -798,6 +798,10 @@ impl WalkBuilder { /// /// When disabled, git-related ignore rules are applied even when searching /// outside a git repository. + /// + /// In particular, if this is `false` then `.gitignore` files will be read + /// from parent directories above the git root directory containing `.git`, + /// which is different from the git behavior. pub fn require_git(&mut self, yes: bool) -> &mut WalkBuilder { self.ig_builder.require_git(yes); self