Skip to content
Permalink
Browse files

Merging Support

  • Loading branch information
kendfinger committed Aug 24, 2014
1 parent 0c61d9a commit 56d5e4d05bb3b685cac19c61f91f81f22281bd4a
Showing with 22 additions and 0 deletions.
  1. +22 −0 lib/src/common/repo.dart
@@ -306,6 +306,10 @@ class Repository {
Future<PullRequest> createPullRequest(CreateReleaseRequest request) {
return github.postJSON("/repos/${fullName}/pulls", convert: PullRequest.fromJSON, body: request.toJSON());
}

Future<Commit> merge(CreateMerge request) {
return github.postJSON("/repos/${fullName}/merges", body: request.toJSON(), convert: Commit.fromJSON, statusCode: 201);
}
}

/**
@@ -553,4 +557,22 @@ class CreateFork {
putValue("organization", organization, map);
return JSON.encode(map);
}
}

class CreateMerge {
final String base;
final String head;

@ApiName("commit_message")
String commitMessage;

CreateMerge(this.base, this.head);

String toJSON() {
var map = {};
putValue("base", base, map);
putValue("head", head, map);
putValue("commit_message", commitMessage, map);
return JSON.encode(map);
}
}

0 comments on commit 56d5e4d

Please sign in to comment.
You can’t perform that action at this time.