refactor: Rename cwd as full_path_base

Because I think it makes it's intention more clear.
This commit is contained in:
Thayne McCombs
2026-03-17 00:53:34 -06:00
parent cd4fd03fa0
commit dc9c503c7d
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ pub struct Config {
/// Cached current working directory for absolute path construction.
/// Populated when `--full-path` is set; `None` means search by filename only.
pub cwd: Option<PathBuf>,
pub full_path_base: Option<PathBuf>,
/// Whether to ignore hidden files and directories (or not).
pub ignore_hidden: bool,
+2 -2
View File
@@ -245,7 +245,7 @@ fn construct_config(mut opts: Opts, pattern_regexps: &[String]) -> Result<Config
let command = extract_command(&mut opts, colored_output)?;
let has_command = command.is_some();
let cwd = if opts.full_path {
let full_path_base = if opts.full_path {
Some(env::current_dir().context(
"Could not determine current directory. \
This is required for --full-path.",
@@ -256,7 +256,7 @@ fn construct_config(mut opts: Opts, pattern_regexps: &[String]) -> Result<Config
Ok(Config {
case_sensitive,
cwd,
full_path_base,
ignore_hidden: !(opts.hidden || opts.rg_alias_ignore()),
read_fdignore: !(opts.no_ignore || opts.rg_alias_ignore()),
read_vcsignore: !(opts.no_ignore || opts.rg_alias_ignore() || opts.no_ignore_vcs),
+1 -1
View File
@@ -524,7 +524,7 @@ impl WorkerState {
// Check the name first, since it doesn't require metadata
let entry_path = entry.path();
let search_str = search_str_for_entry(entry_path, config.cwd.as_deref());
let search_str = search_str_for_entry(entry_path, config.full_path_base.as_deref());
if !patterns
.iter()