From 1e383309143cc9e9287a2531115bd63c7e47bb88 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Mon, 13 May 2024 19:04:48 +0100 Subject: [PATCH] feat(git): add git_dir value to error when reset fails --- Cargo.toml | 2 +- crates/git/src/reset.rs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index dce17b9..dc6b127 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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] diff --git a/crates/git/src/reset.rs b/crates/git/src/reset.rs index 2fe4cbd..4be02ed 100644 --- a/crates/git/src/reset.rs +++ b/crates/git/src/reset.rs @@ -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) } }