Skip to content

Commit aba9c17

Browse files
committed
Assure we don't try to not have wants in pack-receive
Otherwise we will fail to produce a nice error message.
1 parent cb39fcb commit aba9c17

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

gitoxide-core/src/pack/receive.rs

+10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use crate::pack::receive::protocol::fetch::negotiate;
33
use crate::OutputFormat;
44
use gix::config::tree::Key;
55
use gix::protocol::maybe_async;
6+
use gix::remote::fetch::Error;
67
use gix::DynNestedProgress;
78
pub use gix::{
89
hash::ObjectId,
@@ -92,6 +93,15 @@ where
9293
gix::protocol::fetch::refmap::init::Options::default(),
9394
)
9495
.await?;
96+
97+
if refmap.mappings.is_empty() && !refmap.remote_refs.is_empty() {
98+
return Err(Error::NoMapping {
99+
refspecs: refmap.refspecs.clone(),
100+
num_remote_refs: refmap.remote_refs.len(),
101+
}
102+
.into());
103+
}
104+
95105
let mut negotiate = Negotiate { refmap: &refmap };
96106
gix::protocol::fetch(
97107
&mut negotiate,

0 commit comments

Comments
 (0)