Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2012-07-26 16:41:48 +0000
committerKevin Sawicki2012-07-26 16:41:48 +0000
commitd86f041d7fbc55c6c47213895da65974673125e5 (patch)
tree6ce7e90e415d3ca82b0adda384679ae3e02b9264
parentf0e4591c0b212c82e67cd7cb3d0728214172959c (diff)
downloadegit-github-d86f041d7fbc55c6c47213895da65974673125e5.tar.gz
egit-github-d86f041d7fbc55c6c47213895da65974673125e5.tar.xz
egit-github-d86f041d7fbc55c6c47213895da65974673125e5.zip
Add comment count field to Commit model class
-rw-r--r--org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/CommitTest.java2
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Commit.java18
2 files changed, 20 insertions, 0 deletions
diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/CommitTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/CommitTest.java
index f99a71fd..22d7a34e 100644
--- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/CommitTest.java
+++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/CommitTest.java
@@ -38,6 +38,7 @@ public class CommitTest {
assertNull(commit.getSha());
assertNull(commit.getTree());
assertNull(commit.getUrl());
+ assertEquals(0, commit.getCommentCount());
}
/**
@@ -59,5 +60,6 @@ public class CommitTest {
tree.setSha("12345");
assertEquals(tree, commit.setTree(tree).getTree());
assertEquals("url", commit.setUrl("url").getUrl());
+ assertEquals(32, commit.setCommentCount(32).getCommentCount());
}
}
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Commit.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Commit.java
index 4d753d85..9f17defb 100644
--- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Commit.java
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Commit.java
@@ -25,6 +25,8 @@ public class Commit implements Serializable {
private CommitUser committer;
+ private int commentCount;
+
private List<Commit> parents;
private String message;
@@ -68,6 +70,22 @@ public class Commit implements Serializable {
}
/**
+ * @return commentCount
+ */
+ public int getCommentCount() {
+ return commentCount;
+ }
+
+ /**
+ * @param commentCount
+ * @return this commit
+ */
+ public Commit setCommentCount(int commentCount) {
+ this.commentCount = commentCount;
+ return this;
+ }
+
+ /**
* @return parents
*/
public List<Commit> getParents() {

Back to the top