From 2fa2c4b88ab734f08fdda3c3b3024cfe825b352f Mon Sep 17 00:00:00 2001 From: piegames Date: Tue, 25 Feb 2025 14:31:49 +0100 Subject: [PATCH] git: Disable terminal prompt Fixes #100 --- src/git.rs | 2 ++ src/nix.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/git.rs b/src/git.rs index 3032aac..d21c56b 100644 --- a/src/git.rs +++ b/src/git.rs @@ -617,6 +617,8 @@ impl RemoteInfo { /// Convenience wrapper around calling `git ls-remote` async fn fetch_remote(args: &[&str]) -> Result> { let process = Command::new("git") + // Disable any interactive login attempts, failing gracefully instead + .env("GIT_TERMINAL_PROMPT", "0") .arg("ls-remote") .args(args) .output() diff --git a/src/nix.rs b/src/nix.rs index 9825f3d..787a261 100644 --- a/src/nix.rs +++ b/src/nix.rs @@ -41,6 +41,8 @@ pub async fn nix_prefetch_git( output.arg("--fetch-submodules"); } let output = output + // Disable any interactive login attempts, failing gracefully instead + .env("GIT_TERMINAL_PROMPT", "0") .arg(url) .arg(git_ref.as_ref()) .output()