Skip to content

Commit

Permalink
Assure we don't try to not have wants in pack-receive
Browse files Browse the repository at this point in the history
Otherwise we will fail to produce a nice error message.
  • Loading branch information
Byron committed Dec 20, 2024
1 parent 41b6571 commit 377ca46
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions gitoxide-core/src/pack/receive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::pack::receive::protocol::fetch::negotiate;
use crate::OutputFormat;
use gix::config::tree::Key;
use gix::protocol::maybe_async;
use gix::remote::fetch::Error;
use gix::DynNestedProgress;
pub use gix::{
hash::ObjectId,
Expand Down Expand Up @@ -92,6 +93,15 @@ where
gix::protocol::fetch::refmap::init::Options::default(),
)
.await?;

if refmap.mappings.is_empty() && !refmap.remote_refs.is_empty() {
return Err(Error::NoMapping {
refspecs: refmap.refspecs.clone(),
num_remote_refs: refmap.remote_refs.len(),
}
.into());
}

let mut negotiate = Negotiate { refmap: &refmap };
gix::protocol::fetch(
&mut negotiate,
Expand Down

0 comments on commit 377ca46

Please sign in to comment.