fix: make ya pkg ignore default remote name in user Git config

This commit is contained in:
sxyazi 2026-01-31 18:23:47 +08:00
parent a015d4a7ef
commit 68710cd9fc
No known key found for this signature in database

View file

@ -43,7 +43,14 @@ impl Git {
} }
async fn exec(f: impl FnOnce(&mut Command) -> &mut Command) -> Result<()> { async fn exec(f: impl FnOnce(&mut Command) -> &mut Command) -> Result<()> {
let status = f(Command::new("git").args(["-c", "advice.detachedHead=false"])) let status = f(Command::new("git").args([
"-c",
"advice.detachedHead=false",
"-c",
"checkout.defaultRemote=origin",
"-c",
"clone.defaultRemoteName=origin",
]))
.status() .status()
.await .await
.context("Failed to execute `git` command")?; .context("Failed to execute `git` command")?;