We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent adbbbf4 commit c776e8dCopy full SHA for c776e8d
src/cred.rs
@@ -299,7 +299,7 @@ impl CredentialHelper {
299
300
if cmd.starts_with('!') {
301
self.commands.push(cmd[1..].to_string());
302
- } else if cmd.contains("/") || cmd.contains("\\") {
+ } else if is_absolute_path(cmd) {
303
self.commands.push(cmd.to_string());
304
} else {
305
self.commands.push(format!("git credential-{}", cmd));
@@ -481,6 +481,12 @@ impl CredentialHelper {
481
}
482
483
484
+fn is_absolute_path(path: &str) -> bool {
485
+ path.starts_with('/')
486
+ || path.starts_with('\\')
487
+ || cfg!(windows) && path.chars().nth(1).is_some_and(|x| x == ':')
488
+}
489
+
490
#[cfg(test)]
491
mod test {
492
use std::env;
0 commit comments