From 2241f53e3024c98db695f1829b948db45ff063dd Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 7 Jun 2019 10:20:25 -0700 Subject: [PATCH] Relax credential helper checks Instead of looking for an absolute path and pattern matching to avoid using `git credential-*` instead just look directly for `/` or `\`. This'll handle a new case of `C:/foo/bar` on Windows where previously only `C:\foo\bar` worked. --- src/cred.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cred.rs b/src/cred.rs index ad5e86b03e..c217872f11 100644 --- a/src/cred.rs +++ b/src/cred.rs @@ -269,7 +269,7 @@ impl CredentialHelper { if cmd.starts_with('!') { self.commands.push(cmd[1..].to_string()); - } else if cmd.starts_with('/') || cmd.starts_with('\\') || cmd[1..].starts_with(":\\") { + } else if cmd.contains("/") || cmd.contains("\\") { self.commands.push(cmd.to_string()); } else { self.commands.push(format!("git credential-{}", cmd)); @@ -347,6 +347,7 @@ impl CredentialHelper { .stdin(Stdio::piped()) .stdout(Stdio::piped()) .stderr(Stdio::piped()); + debug!("executing credential helper {:?}", c); let mut p = match c.spawn() { Ok(p) => p, Err(e) => { @@ -360,6 +361,7 @@ impl CredentialHelper { .stdin(Stdio::piped()) .stdout(Stdio::piped()) .stderr(Stdio::piped()); + debug!("executing credential helper {:?}", c); match c.spawn() { Ok(p) => p, Err(e) => {