From d0354400f00060bbef673dc6a34123a75ba45fa7 Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 16:49:28 -0400 Subject: [PATCH] Use system git for committing (cherry-pick #26705) (#26726) Cherry-picked Use system git for committing (#26705) Closes #26472 Release Notes: - On macOS, switched to using the system's git binary to create commits. This fixes issues that some users were seeing with pre-commit hooks. Compatibility note: after this change, it is no longer possible to commit from Zed unless git is installed. Co-authored-by: Cole Miller --- crates/git/src/repository.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/git/src/repository.rs b/crates/git/src/repository.rs index ad0798e6194d2fc920bc57663cca86d660a65c05..bec3822285452e1e232e47efd24e9a0035f3e5bf 100644 --- a/crates/git/src/repository.rs +++ b/crates/git/src/repository.rs @@ -795,9 +795,8 @@ impl GitRepository for RealGitRepository { cx: AsyncApp, ) -> BoxFuture> { let working_directory = self.working_directory(); - let git_binary_path = self.git_binary_path.clone(); cx.background_spawn(async move { - let mut cmd = new_smol_command(&git_binary_path); + let mut cmd = new_smol_command("git"); cmd.current_dir(&working_directory?) .envs(env) .args(["commit", "--quiet", "-m"])