diff options
author | Thayne McCombs <astrothayne@gmail.com> | 2023-10-22 00:24:34 -0600 |
---|---|---|
committer | David Peter <sharkdp@users.noreply.github.com> | 2023-10-23 08:34:03 +0200 |
commit | 53fd416c47e0d1a5311c4a2217c7c0ccbe444505 (patch) | |
tree | 13ad4bda826dfca5eb857fa4cb06ab39eee70754 /src | |
parent | 5e0018fb1fa197e7fd8d5fb526649db8c64267f6 (diff) |
docs: Document exclusion of .git/
Diffstat (limited to 'src')
-rw-r--r-- | src/cli.rs | 8 | ||||
-rw-r--r-- | src/walk.rs | 2 |
2 files changed, 7 insertions, 3 deletions
@@ -32,6 +32,8 @@ pub struct Opts { /// Include hidden directories and files in the search results (default: /// hidden files and directories are skipped). Files and directories are /// considered to be hidden if their name starts with a `.` sign (dot). + /// Any files or directories that are ignored due to the rules described by + /// --no-ignore are still ignored unless otherwise specified. /// The flag can be overridden with --no-hidden. #[arg( long, @@ -46,7 +48,8 @@ pub struct Opts { no_hidden: (), /// Show search results from files and directories that would otherwise be - /// ignored by '.gitignore', '.ignore', '.fdignore', or the global ignore file. + /// ignored by '.gitignore', '.ignore', '.fdignore', the global ignore file, + /// or the rule to exclude .git/. /// The flag can be overridden with --ignore. #[arg( long, @@ -61,7 +64,8 @@ pub struct Opts { ignore: (), ///Show search results from files and directories that would otherwise be - /// ignored by '.gitignore' files. The flag can be overridden with --ignore-vcs. + /// ignored by '.gitignore' files or the rule to exclude .git/. + /// The flag can be overridden with --ignore-vcs. #[arg( long, hide_short_help = true, diff --git a/src/walk.rs b/src/walk.rs index 8d904bd..01fe38c 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -69,7 +69,7 @@ pub fn scan(paths: &[PathBuf], patterns: Arc<Vec<Regex>>, config: Arc<Config>) - if config.read_vcsignore { override_builder - .add("!.git") + .add("!.git/") .expect("Invalid exclude pattern"); } |