From da72557cf70313a5400b62a9ddd45493da28e52c Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Sun, 29 Jun 2025 09:52:38 +0000 Subject: [PATCH] git-remote-rad: Allow pushing from bare repositories Bare git repositories are meant to fetch into/push from and fetching works, but pushing from a bare repo into radicle-storage was prohibited. This is a problem for me as I want to use `jj`, which uses a bare git repository in the back (when not co-located into a "normal" git repository). --- crates/radicle-remote-helper/src/push.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/radicle-remote-helper/src/push.rs b/crates/radicle-remote-helper/src/push.rs index 0c3f0ec0..01bba5b2 100644 --- a/crates/radicle-remote-helper/src/push.rs +++ b/crates/radicle-remote-helper/src/push.rs @@ -855,9 +855,7 @@ fn push_ref( // Nb. The *force* indicator (`+`) is processed by Git tooling before we even reach this code. // This happens during the `list for-push` phase. let refspec = git::Refspec { src, dst, force }; - let repo = working.workdir().ok_or(Error::BareRepository { - path: working.path().to_path_buf(), - })?; + let repo = working.workdir().unwrap_or_else(|| working.path()); radicle::git::run::<_, _, &str, &str>( repo,