feat(git): add git_dir value to error when reset fails

This commit is contained in:
Paul Campbell 2024-05-13 19:04:48 +01:00
parent e34d5c2c2c
commit 1e38330914
2 changed files with 5 additions and 4 deletions

View file

@ -3,7 +3,7 @@ resolver = "2"
members = ["crates/cli", "crates/server", "crates/config", "crates/git"]
[workspace.package]
version = "0.3.0"
version = "0.3.2"
edition = "2021"
[workspace.lints.clippy]

View file

@ -40,8 +40,9 @@ pub fn reset(
origin.expose_secret()
)
.into();
let git_dir = repository.deref().git_dir();
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()
};
match gix::command::prepare(command.expose_secret())
@ -57,12 +58,12 @@ pub fn reset(
Ok(())
}
Err(err) => {
warn!(?err, "Failed (wait)");
warn!(?err, ?git_dir, "Failed (wait)");
Err(BranchResetError::Push)
}
},
Err(err) => {
warn!(?err, "Failed (spawn)");
warn!(?err, ?git_dir, "Failed (spawn)");
Err(BranchResetError::Push)
}
}