From 66e6834964384fea17b82937f4b766d7a5986e8f Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sun, 12 Jan 2025 19:44:33 +0100 Subject: [PATCH] adapt to changes in `gix-refspec` --- gix-protocol/src/fetch/refmap/init.rs | 2 +- gix/src/clone/fetch/util.rs | 8 ++++---- gix/src/remote/connection/fetch/update_refs/tests.rs | 2 +- gix/src/repository/config/branch.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gix-protocol/src/fetch/refmap/init.rs b/gix-protocol/src/fetch/refmap/init.rs index f8168d50968..5efaac44c25 100644 --- a/gix-protocol/src/fetch/refmap/init.rs +++ b/gix-protocol/src/fetch/refmap/init.rs @@ -110,7 +110,7 @@ impl RefMap { let num_explicit_specs = fetch_refspecs.len(); let group = gix_refspec::MatchGroup::from_fetch_specs(all_refspecs.iter().map(gix_refspec::RefSpec::to_ref)); let (res, fixes) = group - .match_remotes(remote_refs.iter().map(|r| { + .match_lhs(remote_refs.iter().map(|r| { let (full_ref_name, target, object) = r.unpack(); gix_refspec::match_group::Item { full_ref_name, diff --git a/gix/src/clone/fetch/util.rs b/gix/src/clone/fetch/util.rs index 54458c2c9b5..780af0f5218 100644 --- a/gix/src/clone/fetch/util.rs +++ b/gix/src/clone/fetch/util.rs @@ -206,7 +206,7 @@ pub(super) fn find_custom_refname<'a>( object: None, }) .collect(); - let res = group.match_remotes(filtered_items.iter().copied()); + let res = group.match_lhs(filtered_items.iter().copied()); match res.mappings.len() { 0 => Err(Error::RefNameMissing { wanted: ref_name.clone(), @@ -221,9 +221,9 @@ pub(super) fn find_custom_refname<'a>( wanted: ref_name.clone(), candidates: res .mappings - .iter() + .into_iter() .filter_map(|m| match m.lhs { - gix_refspec::match_group::SourceRef::FullName(name) => Some(name.to_owned()), + gix_refspec::match_group::SourceRef::FullName(name) => Some(name.into_owned()), gix_refspec::match_group::SourceRef::ObjectId(_) => None, }) .collect(), @@ -252,7 +252,7 @@ fn setup_branch_config( .expect("remote was just created and must be visible in config"); let group = gix_refspec::MatchGroup::from_fetch_specs(remote.fetch_specs.iter().map(gix_refspec::RefSpec::to_ref)); let null = gix_hash::ObjectId::null(repo.object_hash()); - let res = group.match_remotes( + let res = group.match_lhs( Some(gix_refspec::match_group::Item { full_ref_name: branch.as_bstr(), target: branch_id.unwrap_or(&null), diff --git a/gix/src/remote/connection/fetch/update_refs/tests.rs b/gix/src/remote/connection/fetch/update_refs/tests.rs index 980634956ea..f5e2e71dad4 100644 --- a/gix/src/remote/connection/fetch/update_refs/tests.rs +++ b/gix/src/remote/connection/fetch/update_refs/tests.rs @@ -920,7 +920,7 @@ mod update { let mut references: Vec<_> = references.all().unwrap().map(|r| into_remote_ref(r.unwrap())).collect(); references.push(into_remote_ref(remote_repo.find_reference("HEAD").unwrap())); let mappings = group - .match_remotes(references.iter().map(remote_ref_to_item)) + .match_lhs(references.iter().map(remote_ref_to_item)) .mappings .into_iter() .map(|m| fetch::refmap::Mapping { diff --git a/gix/src/repository/config/branch.rs b/gix/src/repository/config/branch.rs index 55ad7fda50a..661dbb264d0 100644 --- a/gix/src/repository/config/branch.rs +++ b/gix/src/repository/config/branch.rs @@ -196,7 +196,7 @@ fn matching_remote<'a>( .collect(), }; let null_id = object_hash.null(); - let out = search.match_remotes( + let out = search.match_lhs( Some(gix_refspec::match_group::Item { full_ref_name: lhs.as_bstr(), target: &null_id,