| |
}
|
| |
};
|
| |
|
| - |
let (event_type, push, patch) = match parse_ref(name) {
|
| - |
None => Err(MessageError::NoEventHandler)?,
|
| - |
Some(ParsedRef::Patch(_oid)) => (
|
| - |
EventType::Patch,
|
| - |
None,
|
| - |
Some(self.build_trigger_from_patch(event, repository, &repo, profile, author)?),
|
| - |
),
|
| - |
Some(ParsedRef::Push(_branch)) => (
|
| - |
EventType::Push,
|
| - |
Some(self.build_trigger_from_push(
|
| + |
match parse_ref(name) {
|
| + |
None => Err(MessageError::NoEventHandler),
|
| + |
Some(ParsedRef::Patch(_oid)) => Ok(Request::Trigger {
|
| + |
common: EventCommonFields {
|
| + |
version: PROTOCOL_VERSION,
|
| + |
event_type: EventType::Patch,
|
| + |
repository: msg_repository,
|
| + |
},
|
| + |
push: None,
|
| + |
patch: Some(
|
| + |
self.build_trigger_from_patch(event, repository, &repo, profile, author)?,
|
| + |
),
|
| + |
}),
|
| + |
Some(ParsedRef::Push(_branch)) => Ok(Request::Trigger {
|
| + |
common: EventCommonFields {
|
| + |
version: PROTOCOL_VERSION,
|
| + |
event_type: EventType::Push,
|
| + |
repository: msg_repository,
|
| + |
},
|
| + |
push: Some(self.build_trigger_from_push(
|
| |
repo,
|
| |
author,
|
| |
name,
|
| |
old.unwrap_or(*oid),
|
| |
*oid,
|
| |
)?),
|
| - |
None,
|
| - |
),
|
| - |
};
|
| - |
|
| - |
let common = EventCommonFields {
|
| - |
version: PROTOCOL_VERSION,
|
| - |
event_type,
|
| - |
repository: msg_repository,
|
| - |
};
|
| - |
|
| - |
Ok(Request::Trigger {
|
| - |
common,
|
| - |
push,
|
| - |
patch,
|
| - |
})
|
| + |
patch: None,
|
| + |
}),
|
| + |
}
|
| |
}
|
| |
|
| |
fn build_trigger_from_patch(
|