mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: make ya pkg ignore default remote name in user Git config
This commit is contained in:
parent
a015d4a7ef
commit
68710cd9fc
1 changed files with 11 additions and 4 deletions
|
|
@ -43,10 +43,17 @@ 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([
|
||||||
.status()
|
"-c",
|
||||||
.await
|
"advice.detachedHead=false",
|
||||||
.context("Failed to execute `git` command")?;
|
"-c",
|
||||||
|
"checkout.defaultRemote=origin",
|
||||||
|
"-c",
|
||||||
|
"clone.defaultRemoteName=origin",
|
||||||
|
]))
|
||||||
|
.status()
|
||||||
|
.await
|
||||||
|
.context("Failed to execute `git` command")?;
|
||||||
|
|
||||||
if !status.success() {
|
if !status.success() {
|
||||||
bail!("`git` command failed: {status}");
|
bail!("`git` command failed: {status}");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue