]> quire.kejadlen.dev Git - quire.git/commitdiff
Dispatch git subcommands via the git binary
authorAlpha Chen <alpha@kejadlen.dev>
Mon, 27 Apr 2026 03:07:45 +0000 (20:07 -0700)
committerAlpha Chen <alpha@kejadlen.dev>
Mon, 27 Apr 2026 03:11:25 +0000 (20:11 -0700)
The standalone git-receive-pack binary lives in libexec/git-core/, which
is not on PATH in the container. Using `git receive-pack` lets the git
binary handle the dispatch internally.

Assisted-by: GLM-5.1 via pi
src/bin/quire/commands/exec.rs

index f40892459b7fe38b610d3bcf906cac1531661b25..59f8f9e186a464ee48d2cb6a640733e0836876bf 100644 (file)
@@ -48,7 +48,13 @@ fn dispatch_git(quire: &Quire, git_cmd: &str, args: &[String]) -> Result<()> {
     ensure!(repo.exists(), "repository not found: {path}");
 
     tracing::info!(%git_cmd, %path, "dispatching git command");
-    let err = Command::new(git_cmd)
+    // Use `git <subcommand>` instead of `git-<subcommand>` so the git
+    // binary handles dispatch to libexec/git-core/ internally.
+    let subcommand = git_cmd
+        .strip_prefix("git-")
+        .ok_or_else(|| miette::miette!("unexpected git command: {git_cmd}"))?;
+    let err = Command::new("git")
+        .arg(subcommand)
         .arg(".")
         .current_dir(repo.path())
         .exec();