node: Test push/pull flow

Signed-off-by: Slack Coder <slackcoder@server.ky>
This commit is contained in:
Slack Coder
2022-09-13 10:16:05 +02:00
committed by Alexis Sellier
parent a70a6822e0
commit 825bd3f5e1
4 changed files with 103 additions and 4 deletions
+10 -2
View File
@@ -201,8 +201,16 @@ impl Peer {
// TODO: Check that we're tracking this user as well.
if ctx.config.is_tracking(&id) {
// TODO: Check refs to see if we should try to fetch or not.
let updated = ctx.fetch(&id, git);
if !updated.is_empty() {
let updated_refs = ctx.fetch(&id, git);
let is_updated = !updated_refs.is_empty();
ctx.io.push_back(Io::Event(Event::RefsFetched {
from: git.clone(),
project: id.clone(),
updated: updated_refs,
}));
if is_updated {
return Ok(Some(Message::RefsUpdate {
id,
signer,