node: Propagate ref updates

Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
Alexis Sellier
2022-09-13 10:16:05 +02:00
parent cb4939fd75
commit db6932d58c
6 changed files with 109 additions and 28 deletions
+2 -2
View File
@@ -9,8 +9,8 @@ use crate::test::crypto::MockSigner;
pub fn storage<P: AsRef<Path>>(path: P) -> Storage {
let path = path.as_ref();
let proj_ids = arbitrary::set::<Id>(3..5);
let signers = arbitrary::set::<MockSigner>(1..3);
let proj_ids = arbitrary::set::<Id>(3..=3);
let signers = arbitrary::set::<MockSigner>(3..=3);
let mut storages = signers
.into_iter()
.map(|s| Storage::open(path, s).unwrap())
+3 -3
View File
@@ -3,7 +3,7 @@ use git_url::Url;
use crate::crypto::{PublicKey, Verified};
use crate::git;
use crate::identity::{Id, Project};
use crate::storage::refs;
use crate::storage::{refs, RefUpdate};
use crate::storage::{
Error, Inventory, ReadRepository, ReadStorage, Remote, RemoteId, WriteRepository, WriteStorage,
};
@@ -122,8 +122,8 @@ impl ReadRepository<'_> for MockRepository {
}
impl WriteRepository<'_> for MockRepository {
fn fetch(&mut self, _url: &Url) -> Result<(), git2::Error> {
Ok(())
fn fetch(&mut self, _url: &Url) -> Result<Vec<RefUpdate>, git2::Error> {
Ok(vec![])
}
fn raw(&self) -> &git2::Repository {