Skip to content

Commit

Permalink
adapt to changes in gix-submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Sep 2, 2023
1 parent 25c5bce commit f8471b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion gix/src/submodule/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub mod is_active {
#[error(transparent)]
InitIsActivePlatform(#[from] gix_submodule::is_active_platform::Error),
#[error(transparent)]
QueryIsActive(#[from] gix_submodule::is_active_platform::is_active::Error),
QueryIsActive(#[from] gix_config::value::Error),
#[error(transparent)]
InitAttributes(#[from] crate::config::attribute_stack::Error),
#[error(transparent)]
Expand Down
25 changes: 10 additions & 15 deletions gix/src/submodule/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,21 +140,16 @@ impl<'repo> Submodule<'repo> {
/// Please see the [plumbing crate documentation](gix_submodule::IsActivePlatform::is_active()) for details.
pub fn is_active(&self) -> Result<bool, is_active::Error> {
let (mut platform, mut attributes) = self.state.active_state_mut()?;
let is_active = platform.is_active(
&self.state.modules,
&self.state.repo.config.resolved,
self.name.as_ref(),
{
|relative_path, case, is_dir, out| {
attributes
.set_case(case)
.at_entry(relative_path, Some(is_dir), |id, buf| {
self.state.repo.objects.find_blob(id, buf)
})
.map_or(false, |platform| platform.matching_attributes(out))
}
},
)?;
let is_active = platform.is_active(&self.state.repo.config.resolved, self.name.as_ref(), {
|relative_path, case, is_dir, out| {
attributes
.set_case(case)
.at_entry(relative_path, Some(is_dir), |id, buf| {
self.state.repo.objects.find_blob(id, buf)
})
.map_or(false, |platform| platform.matching_attributes(out))
}
})?;
Ok(is_active)
}

Expand Down

0 comments on commit f8471b1

Please sign in to comment.