Skip to content

Commit

Permalink
Merge branch 'match_ceiling_dir_or_error'
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Dec 18, 2023
2 parents f7adf97 + 2e04403 commit cda5b51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 0 additions & 4 deletions gix-discover/src/upwards/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,12 @@ impl Options<'_> {
///
/// Note that `GIT_DISCOVERY_ACROSS_FILESYSTEM` for `cross_fs` is **not** read,
/// as it requires parsing of `git-config` style boolean values.
///
/// In addition, this function disables `match_ceiling_dir_or_error` to allow
/// discovery if an outside environment variable sets non-matching ceiling directories.
// TODO: test
pub fn apply_environment(mut self) -> Self {
let name = "GIT_CEILING_DIRECTORIES";
if let Some(ceiling_dirs) = env::var_os(name) {
self.ceiling_dirs = parse_ceiling_dirs(&ceiling_dirs);
}
self.match_ceiling_dir_or_error = false;
self
}
}
Expand Down
6 changes: 6 additions & 0 deletions gix/src/discover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ impl ThreadSafeRepository {
///
/// Finally, use the `trust_map` to determine which of our own repository options to use
/// based on the trust level of the effective repository directory.
///
/// ### Note
///
/// Consider to set [`match_ceiling_dir_or_error = false`](gix_discover::upwards::Options::match_ceiling_dir_or_error)
/// to allow discovery if an outside environment variable sets non-matching ceiling directories for greater
/// compatibility with Git.
#[momo]
pub fn discover_with_environment_overrides_opts(
directory: impl AsRef<Path>,
Expand Down

0 comments on commit cda5b51

Please sign in to comment.