Commit c4ed186b authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'mr-hook-opt-diff-refs'

bb347e7c

 types: diff_refs can be null
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Brad King's avatarBrad King <brad.king@kitware.com>
Merge-request: !135
parents 7d5628cb bb347e7c
......@@ -295,11 +295,11 @@ fn test_read_merge_request() {
assert_eq!(merge_request.merge_status, MergeStatus::CanBeMerged);
assert_eq!(merge_request.sha,
Some(ObjectId::new("04e94ae667024a62a90179f395bfdc2b35f3efd2")));
assert_eq!(merge_request.diff_refs.base_sha,
assert_eq!(merge_request.diff_refs.as_ref().unwrap().base_sha,
Some(ObjectId::new("981262b03fc0149c1677ca51ea47b570e30d6a90")));
assert_eq!(merge_request.diff_refs.head_sha,
assert_eq!(merge_request.diff_refs.as_ref().unwrap().head_sha,
Some(ObjectId::new("04e94ae667024a62a90179f395bfdc2b35f3efd2")));
assert_eq!(merge_request.diff_refs.start_sha,
assert_eq!(merge_request.diff_refs.as_ref().unwrap().start_sha,
Some(ObjectId::new("981262b03fc0149c1677ca51ea47b570e30d6a90")));
assert_eq!(merge_request.merge_commit_sha, None);
assert_eq!(merge_request.subscribed, Some(true));
......
......@@ -1434,7 +1434,7 @@ pub struct MergeRequest {
/// This is `None` if the source branch has been deleted.
pub sha: Option<ObjectId>,
/// The commits used to construct the merge request diffs.
pub diff_refs: DiffRefs,
pub diff_refs: Option<DiffRefs>,
/// The object ID of the commit which merged the merge request.
pub merge_commit_sha: Option<ObjectId>,
/// Whether the current user is subscribed or not.
......@@ -1527,7 +1527,7 @@ pub struct MergeRequestChanges {
/// This is `None` if the source branch has been deleted.
pub sha: Option<ObjectId>,
/// The commits used to construct the merge request diffs.
pub diff_refs: DiffRefs,
pub diff_refs: Option<DiffRefs>,
/// The object ID of the commit which merged the merge request.
pub merge_commit_sha: Option<ObjectId>,
/// GitLab does not include this in responses with lists of merge requests but
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment