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).
This commit is contained in:
Tobias Hunger 2025-06-29 09:52:38 +00:00 committed by Fintan Halpenny
parent 271ef497d7
commit da72557cf7
1 changed files with 1 additions and 3 deletions

View File

@ -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,