Use repository Git remotes and SSH config
Some checks failed
Dependency security audit / rustsec (push) Has been cancelled
Some checks failed
Dependency security audit / rustsec (push) Has been cancelled
This commit is contained in:
@@ -102,6 +102,37 @@ fn explicit_relative_configuration_resolves_deterministically() -> TestResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "ios", target_os = "watchos")))]
|
||||
#[test]
|
||||
fn desktop_configuration_uses_repository_remotes_without_duplicate_settings() -> TestResult {
|
||||
let fixture = ConfigurationFixture::new()?;
|
||||
let vault = fixture.temporary.path().join("cwd/vault");
|
||||
fs::create_dir_all(vault.join(".git"))?;
|
||||
fs::write(
|
||||
vault.join(".git/config"),
|
||||
"[remote \"origin\"]\n\turl = git@git.example:team/store.git\n\tfetch = +refs/heads/*:refs/remotes/origin/*\n",
|
||||
)?;
|
||||
fixture.write_explicit(
|
||||
r#"
|
||||
vault = "../vault"
|
||||
default_key = "0123456789ABCDEF0123456789ABCDEF01234567"
|
||||
key_material = "keys"
|
||||
"#,
|
||||
)?;
|
||||
|
||||
let config = fixture
|
||||
.loader()
|
||||
.load(Some(Path::new("config/config.toml")))?;
|
||||
assert_eq!(config.git_remotes().len(), 1);
|
||||
assert_eq!(config.git_remotes()[0].name().as_str(), "origin");
|
||||
assert_eq!(
|
||||
config.git_remotes()[0].url(),
|
||||
"git@git.example:team/store.git"
|
||||
);
|
||||
assert!(config.git_remotes()[0].ssh_authentication().is_none());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn git_commit_identity_defaults_validates_and_persists() -> TestResult {
|
||||
let fixture = ConfigurationFixture::new()?;
|
||||
|
||||
Reference in New Issue
Block a user