mirror of
https://github.com/pesde-pkg/pesde.git
synced 2025-04-06 03:40:59 +01:00
feat: ignore submodules in git dependencies
Previously, if a repository contained a submodule pesde would throw an error since there is no entries for them. Now, they are simply ignored.
This commit is contained in:
parent
ca550eee3a
commit
24049d60a2
1 changed files with 14 additions and 1 deletions
|
@ -388,7 +388,7 @@ impl PackageSource for GitPackageSource {
|
||||||
let object = match repo.find_object(tree_id) {
|
let object = match repo.find_object(tree_id) {
|
||||||
Ok(object) => object,
|
Ok(object) => object,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
return Err(errors::DownloadError::ParseOidToObject(
|
return Err(errors::DownloadError::OidToTree(
|
||||||
tree_id,
|
tree_id,
|
||||||
Box::new(repo_url),
|
Box::new(repo_url),
|
||||||
e,
|
e,
|
||||||
|
@ -413,6 +413,11 @@ impl PackageSource for GitPackageSource {
|
||||||
recorder
|
recorder
|
||||||
.records
|
.records
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
.filter(|entry| {
|
||||||
|
// we do not support submodules, so we filter them out so
|
||||||
|
// find_object does not error
|
||||||
|
entry.mode.kind() != gix::object::tree::EntryKind::Commit
|
||||||
|
})
|
||||||
.map(|entry| {
|
.map(|entry| {
|
||||||
let object = repo.find_object(entry.oid).map_err(|e| {
|
let object = repo.find_object(entry.oid).map_err(|e| {
|
||||||
errors::DownloadError::ParseOidToObject(
|
errors::DownloadError::ParseOidToObject(
|
||||||
|
@ -652,6 +657,14 @@ pub mod errors {
|
||||||
#[source] gix::traverse::tree::breadthfirst::Error,
|
#[source] gix::traverse::tree::breadthfirst::Error,
|
||||||
),
|
),
|
||||||
|
|
||||||
|
/// Getting the tree by object id failed
|
||||||
|
#[error("error getting tree from object id {0} for repository {1}")]
|
||||||
|
OidToTree(
|
||||||
|
ObjectId,
|
||||||
|
Box<gix::Url>,
|
||||||
|
#[source] gix::object::find::existing::Error,
|
||||||
|
),
|
||||||
|
|
||||||
/// An error occurred parsing an object id to object
|
/// An error occurred parsing an object id to object
|
||||||
#[error("error parsing object id {0} to object for repository {1}")]
|
#[error("error parsing object id {0} to object for repository {1}")]
|
||||||
ParseOidToObject(
|
ParseOidToObject(
|
||||||
|
|
Loading…
Add table
Reference in a new issue