Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Oct 10, 2022
1 parent dff66e8 commit 314b5e0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
13 changes: 8 additions & 5 deletions gitoxide-core/src/repository/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub(crate) mod function {
if !ref_specs.is_empty() {
remote.replace_refspecs(ref_specs.iter(), git::remote::Direction::Fetch)?;
}
let res: git::remote::fetch::Outcome<'_> = remote
let res: git::remote::fetch::Outcome = remote
.connect(git::remote::Direction::Fetch, progress)?
.prepare_fetch(Default::default())?
.with_dry_run(dry_run)
Expand Down Expand Up @@ -84,7 +84,7 @@ pub(crate) mod function {
repo: &git::Repository,
update_refs: git::remote::fetch::refs::update::Outcome,
refspecs: &[git::refspec::RefSpec],
mut map: git::remote::fetch::RefMap<'_>,
mut map: git::remote::fetch::RefMap,
mut out: impl std::io::Write,
mut err: impl std::io::Write,
) -> anyhow::Result<()> {
Expand Down Expand Up @@ -121,16 +121,19 @@ pub(crate) mod function {
err,
"The following destination refs were removed as they didn't start with 'ref/'"
)?;
map.fixes.sort_by_key(|f| match f {
Fix::MappingWithPartialDestinationRemoved { spec, .. } => *spec,
map.fixes.sort_by(|l, r| match (l, r) {
(
Fix::MappingWithPartialDestinationRemoved { spec: l, .. },
Fix::MappingWithPartialDestinationRemoved { spec: r, .. },
) => l.cmp(&r),
});
let mut prev_spec = None;
for fix in &map.fixes {
match fix {
Fix::MappingWithPartialDestinationRemoved { name, spec } => {
if prev_spec.map_or(true, |prev_spec| prev_spec != spec) {
prev_spec = spec.into();
spec.write_to(&mut err)?;
spec.to_ref().write_to(&mut err)?;
writeln!(err)?;
}
writeln!(err, "\t{name}")?;
Expand Down
11 changes: 7 additions & 4 deletions gitoxide-core/src/repository/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ mod refs_impl {
pub(crate) fn print_refmap(
repo: &git::Repository,
refspecs: &[RefSpec],
mut map: git::remote::fetch::RefMap<'_>,
mut map: git::remote::fetch::RefMap,
mut out: impl std::io::Write,
mut err: impl std::io::Write,
) -> anyhow::Result<()> {
Expand Down Expand Up @@ -141,16 +141,19 @@ mod refs_impl {
err,
"The following destination refs were removed as they didn't start with 'ref/'"
)?;
map.fixes.sort_by_key(|f| match f {
Fix::MappingWithPartialDestinationRemoved { spec, .. } => *spec,
map.fixes.sort_by(|l, r| match (l, r) {
(
Fix::MappingWithPartialDestinationRemoved { spec: l, .. },
Fix::MappingWithPartialDestinationRemoved { spec: r, .. },
) => l.cmp(&r),
});
let mut prev_spec = None;
for fix in &map.fixes {
match fix {
Fix::MappingWithPartialDestinationRemoved { name, spec } => {
if prev_spec.map_or(true, |prev_spec| prev_spec != spec) {
prev_spec = spec.into();
spec.write_to(&mut err)?;
spec.to_ref().write_to(&mut err)?;
writeln!(err)?;
}
writeln!(err, "\t{name}")?;
Expand Down

0 comments on commit 314b5e0

Please sign in to comment.