Skip to content

Commit

Permalink
Commit Model: Add treeSha and json fields
Browse files Browse the repository at this point in the history
  • Loading branch information
azenla committed Aug 28, 2014
1 parent b688069 commit 58a7616
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/src/common/commits.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ class Commit {
* Commit SHA
*/
String sha;

String treeSha;


/**
* Commit Message
Expand Down Expand Up @@ -77,6 +80,8 @@ class Commit {

Commit(this.github);

Map<String, dynamic> json;

static Commit fromJSON(GitHub github, input) {
var commit = new Commit(github)
..url = input['html_url']
Expand All @@ -86,8 +91,11 @@ class Commit {
..authoredAt = parseDateTime(input['commit']['author']['date'])
..committedAt = parseDateTime(input['commit']['committer']['date'])
..committerEmail = input['commit']['committer']['email']
..authorEmail = input['commit']['author']['email'];
..authorEmail = input['commit']['author']['email']
..treeSha = input['tree']['sha'];

commit.json = input;

if (input['stats'] != null) {
commit
..additionsCount = input['stats']['additions']
Expand Down

0 comments on commit 58a7616

Please sign in to comment.