Skip to content

Commit 9e7dadc

Browse files
committed
adapt to changes in git-repository
1 parent cad6d36 commit 9e7dadc

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

gitoxide-core/src/repository/fetch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ pub(crate) mod function {
100100
mut out: impl std::io::Write,
101101
mut err: impl std::io::Write,
102102
) -> anyhow::Result<()> {
103-
let mut last_spec_index = usize::MAX;
103+
let mut last_spec_index = git::remote::fetch::SpecIndex::ExplicitInRemote(usize::MAX);
104104
let mut updates = update_refs
105-
.iter_mapping_updates(&map.mappings, refspecs)
105+
.iter_mapping_updates(&map.mappings, refspecs, &map.extra_refspecs)
106106
.filter_map(|(update, mapping, spec, edit)| spec.map(|spec| (update, mapping, spec, edit)))
107107
.collect::<Vec<_>>();
108108
updates.sort_by_key(|t| t.2);

gitoxide-core/src/repository/remote.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

0 commit comments

Comments
 (0)