summaryrefslogtreecommitdiffstats
path: root/vendor/gix/src/config/snapshot
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
commit9918693037dce8aa4bb6f08741b6812923486c18 (patch)
tree21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /vendor/gix/src/config/snapshot
parentReleasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff)
downloadrustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz
rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix/src/config/snapshot')
-rw-r--r--vendor/gix/src/config/snapshot/access.rs13
-rw-r--r--vendor/gix/src/config/snapshot/credential_helpers.rs24
2 files changed, 27 insertions, 10 deletions
diff --git a/vendor/gix/src/config/snapshot/access.rs b/vendor/gix/src/config/snapshot/access.rs
index 7dc593880..6b98cf42d 100644
--- a/vendor/gix/src/config/snapshot/access.rs
+++ b/vendor/gix/src/config/snapshot/access.rs
@@ -4,9 +4,8 @@ use std::borrow::Cow;
use gix_features::threading::OwnShared;
use gix_macros::momo;
-use crate::bstr::ByteSlice;
use crate::{
- bstr::{BStr, BString},
+ bstr::{BStr, BString, ByteSlice},
config::{CommitAutoRollback, Snapshot, SnapshotMut},
};
@@ -118,9 +117,13 @@ impl<'repo> SnapshotMut<'repo> {
}
let value = new_value.into();
key.validate(value)?;
- let current = self
- .config
- .set_raw_value(key.section().name(), None, key.name(), value)?;
+ let section = key.section();
+ let current = match section.parent() {
+ Some(parent) => self
+ .config
+ .set_raw_value(parent.name(), Some(section.name().into()), key.name(), value)?,
+ None => self.config.set_raw_value(section.name(), None, key.name(), value)?,
+ };
Ok(current.map(std::borrow::Cow::into_owned))
}
diff --git a/vendor/gix/src/config/snapshot/credential_helpers.rs b/vendor/gix/src/config/snapshot/credential_helpers.rs
index 189e74471..54499a1c3 100644
--- a/vendor/gix/src/config/snapshot/credential_helpers.rs
+++ b/vendor/gix/src/config/snapshot/credential_helpers.rs
@@ -2,11 +2,12 @@ use std::{borrow::Cow, convert::TryFrom};
pub use error::Error;
-use crate::config::cache::util::IgnoreEmptyPath;
+use crate::config::cache::util::ApplyLeniency;
use crate::{
bstr::{ByteSlice, ByteVec},
config::{
- tree::{credential, Core, Credential, Key},
+ cache::util::IgnoreEmptyPath,
+ tree::{credential, gitoxide::Credentials, Core, Credential, Key},
Snapshot,
},
};
@@ -25,6 +26,8 @@ mod error {
},
#[error("core.askpass could not be read")]
CoreAskpass(#[from] gix_config::path::interpolate::Error),
+ #[error(transparent)]
+ BooleanConfig(#[from] crate::config::boolean::Error),
}
}
@@ -144,16 +147,27 @@ impl Snapshot<'_> {
.transpose()
.ignore_empty()?
.map(|c| Cow::Owned(c.into_owned())),
- ..Default::default()
+ mode: self
+ .try_boolean(Credentials::TERMINAL_PROMPT.logical_name().as_str())
+ .map(|val| Credentials::TERMINAL_PROMPT.enrich_error(val))
+ .transpose()
+ .with_leniency(self.repo.config.lenient_config)?
+ .and_then(|val| (!val).then_some(gix_prompt::Mode::Disable))
+ .unwrap_or_default(),
}
- .apply_environment(allow_git_env, allow_ssh_env, allow_git_env);
+ .apply_environment(allow_git_env, allow_ssh_env, false /* terminal prompt */);
Ok((
gix_credentials::helper::Cascade {
programs,
use_http_path,
// The default ssh implementation uses binaries that do their own auth, so our passwords aren't used.
query_user_only: url.scheme == gix_url::Scheme::Ssh,
- ..Default::default()
+ stderr: self
+ .try_boolean(Credentials::HELPER_STDERR.logical_name().as_str())
+ .map(|val| Credentials::HELPER_STDERR.enrich_error(val))
+ .transpose()
+ .with_leniency(self.repo.options.lenient_config)?
+ .unwrap_or(true),
},
gix_credentials::helper::Action::get_for_url(url.to_bstring()),
prompt_options,