feat(git): add git_dir value to error when reset fails
All checks were successful
ci/woodpecker/tag/cron-docker-builder Pipeline was successful
ci/woodpecker/tag/push-next Pipeline was successful
ci/woodpecker/tag/tag-created Pipeline was successful
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
All checks were successful
ci/woodpecker/tag/cron-docker-builder Pipeline was successful
ci/woodpecker/tag/push-next Pipeline was successful
ci/woodpecker/tag/tag-created Pipeline was successful
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
This commit is contained in:
parent
e34d5c2c2c
commit
1e38330914
2 changed files with 5 additions and 4 deletions
|
@ -3,7 +3,7 @@ resolver = "2"
|
||||||
members = ["crates/cli", "crates/server", "crates/config", "crates/git"]
|
members = ["crates/cli", "crates/server", "crates/config", "crates/git"]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.3.0"
|
version = "0.3.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[workspace.lints.clippy]
|
[workspace.lints.clippy]
|
||||||
|
|
|
@ -40,8 +40,9 @@ pub fn reset(
|
||||||
origin.expose_secret()
|
origin.expose_secret()
|
||||||
)
|
)
|
||||||
.into();
|
.into();
|
||||||
|
let git_dir = repository.deref().git_dir();
|
||||||
let ctx = gix::diff::command::Context {
|
let ctx = gix::diff::command::Context {
|
||||||
git_dir: Some(repository.deref().git_dir().to_path_buf()),
|
git_dir: Some(git_dir.to_path_buf()),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
match gix::command::prepare(command.expose_secret())
|
match gix::command::prepare(command.expose_secret())
|
||||||
|
@ -57,12 +58,12 @@ pub fn reset(
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
warn!(?err, "Failed (wait)");
|
warn!(?err, ?git_dir, "Failed (wait)");
|
||||||
Err(BranchResetError::Push)
|
Err(BranchResetError::Push)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
warn!(?err, "Failed (spawn)");
|
warn!(?err, ?git_dir, "Failed (spawn)");
|
||||||
Err(BranchResetError::Push)
|
Err(BranchResetError::Push)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue