Skip to content

Commit acf8b13

Browse files
committed
adapt to changes in git-repository
1 parent e4d78e1 commit acf8b13

File tree

4 files changed

+13
-18
lines changed

4 files changed

+13
-18
lines changed

gitoxide-core/src/repository/clone.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub(crate) mod function {
6767
}
6868

6969
match fetch_outcome.status {
70-
Status::NoChange => {
70+
Status::NoPackReceived { .. } => {
7171
unreachable!("clone always has changes")
7272
}
7373
Status::DryRun { .. } => unreachable!("dry-run unsupported"),

gitoxide-core/src/repository/fetch.rs

+4-12
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,8 @@ pub(crate) mod function {
6060

6161
let ref_specs = remote.refspecs(git::remote::Direction::Fetch);
6262
match res.status {
63-
Status::NoChange => {
64-
let show_unmapped = false;
65-
crate::repository::remote::refs::print_refmap(
66-
&repo,
67-
ref_specs,
68-
res.ref_map,
69-
show_unmapped,
70-
&mut out,
71-
err,
72-
)
63+
Status::NoPackReceived { update_refs } => {
64+
print_updates(&repo, update_refs, ref_specs, res.ref_map, &mut out, err)
7365
}
7466
Status::DryRun { update_refs } => print_updates(&repo, update_refs, ref_specs, res.ref_map, &mut out, err),
7567
Status::Change {
@@ -100,9 +92,9 @@ pub(crate) mod function {
10092
mut out: impl std::io::Write,
10193
mut err: impl std::io::Write,
10294
) -> anyhow::Result<()> {
103-
let mut last_spec_index = usize::MAX;
95+
let mut last_spec_index = git::remote::fetch::SpecIndex::ExplicitInRemote(usize::MAX);
10496
let mut updates = update_refs
105-
.iter_mapping_updates(&map.mappings, refspecs)
97+
.iter_mapping_updates(&map.mappings, refspecs, &map.extra_refspecs)
10698
.filter_map(|(update, mapping, spec, edit)| spec.map(|spec| (update, mapping, spec, edit)))
10799
.collect::<Vec<_>>();
108100
updates.sort_by_key(|t| t.2);

gitoxide-core/src/repository/remote.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ mod refs_impl {
3232
pub handshake_info: bool,
3333
}
3434

35-
pub(crate) use super::{print, print_ref, print_refmap};
35+
pub(crate) use super::{print, print_ref};
3636
}
3737

3838
#[git::protocol::maybe_async::maybe_async]
@@ -116,12 +116,15 @@ mod refs_impl {
116116
mut out: impl std::io::Write,
117117
mut err: impl std::io::Write,
118118
) -> anyhow::Result<()> {
119-
let mut last_spec_index = usize::MAX;
119+
let mut last_spec_index = git::remote::fetch::SpecIndex::ExplicitInRemote(usize::MAX);
120120
map.mappings.sort_by_key(|m| m.spec_index);
121121
for mapping in &map.mappings {
122122
if mapping.spec_index != last_spec_index {
123123
last_spec_index = mapping.spec_index;
124-
let spec = &refspecs[mapping.spec_index];
124+
let spec = mapping
125+
.spec_index
126+
.get(refspecs, &map.extra_refspecs)
127+
.expect("refspecs here are the ones used for mapping");
125128
spec.to_ref().write_to(&mut out)?;
126129
writeln!(out)?;
127130
}
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
index: c787de2aafb897417ca8167baeb146eabd18bc5f
2-
pack: 346574b7331dc3a1724da218d622c6e1b6c66a57
1+
index: 3ff97f80d63a1261147ace4cb06191a2fd686ff6
2+
pack: de6c8d1e0ca3ee9331a3f92da74add15abd03049

0 commit comments

Comments
 (0)