Commit f0f045c9 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

types: support MRs with deleted source branches

The `sha` for such merge requests is `null`.
parent c62fb467
......@@ -270,7 +270,7 @@ fn test_read_merge_request() {
assert_eq!(merge_request.merge_when_build_succeeds, false);
assert_eq!(merge_request.merge_status, MergeStatus::CanBeMerged);
assert_eq!(merge_request.sha,
ObjectId::new("f2784e0607d08e79b361ccf58a8379b04de2df35"));
Some(ObjectId::new("f2784e0607d08e79b361ccf58a8379b04de2df35")));
assert_eq!(merge_request.merge_commit_sha, None);
assert_eq!(merge_request.subscribed, true);
assert_eq!(merge_request.user_notes_count, 7);
......
......@@ -1242,7 +1242,9 @@ pub struct MergeRequest {
/// The status of the merge request.
pub merge_status: MergeStatus,
/// The object ID of the head of the source branch.
pub sha: ObjectId,
///
/// This is `None` if the source branch has been deleted.
pub sha: Option<ObjectId>,
/// 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.
......@@ -1303,7 +1305,9 @@ pub struct MergeRequestChanges {
/// The status of the merge request.
pub merge_status: MergeStatus,
/// The object ID of the head of the source branch.
pub sha: ObjectId,
///
/// This is `None` if the source branch has been deleted.
pub sha: Option<ObjectId>,
/// 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.
......
Supports Markdown
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