From bdf71cb3d5a5ff8399c10c8d2492d3dd01c5fa33 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 26 Nov 2024 16:28:09 +0000 Subject: test(login): update `ngit login` test to reflect the new interface and testing only nsec login --- src/lib/login/existing.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/lib/login/existing.rs') diff --git a/src/lib/login/existing.rs b/src/lib/login/existing.rs index 342f792..872e459 100644 --- a/src/lib/login/existing.rs +++ b/src/lib/login/existing.rs @@ -69,11 +69,18 @@ fn get_signer_info( Ok(match source { None => { let mut result = None; - for source in &[ - SignerInfoSource::CommandLineArguments, - SignerInfoSource::GitLocal, - SignerInfoSource::GitGlobal, - ] { + for source in if std::env::var("NGITTEST").is_ok() { + vec![ + SignerInfoSource::CommandLineArguments, + SignerInfoSource::GitLocal, + ] + } else { + vec![ + SignerInfoSource::CommandLineArguments, + SignerInfoSource::GitLocal, + SignerInfoSource::GitGlobal, + ] + } { if let Ok(res) = get_signer_info(git_repo, signer_info, password, &Some(source.clone())) { -- cgit v1.2.3