Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2012-07-20 12:35:40 -0400
committerKevin Sawicki2012-07-20 12:35:40 -0400
commitf0e4591c0b212c82e67cd7cb3d0728214172959c (patch)
tree38de23992a159d71fb50ea2f216233df712ee554
parent8ea43ddf8e11c1bc90359cc5f108230df1735a18 (diff)
downloadegit-github-f0e4591c0b212c82e67cd7cb3d0728214172959c.tar.gz
egit-github-f0e4591c0b212c82e67cd7cb3d0728214172959c.tar.xz
egit-github-f0e4591c0b212c82e67cd7cb3d0728214172959c.zip
Add before field to PushPayload event model
-rw-r--r--org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PushPayloadTest.java2
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/event/PushPayload.java18
2 files changed, 20 insertions, 0 deletions
diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PushPayloadTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PushPayloadTest.java
index e8ec3c78..acfb64f7 100644
--- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PushPayloadTest.java
+++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PushPayloadTest.java
@@ -35,6 +35,7 @@ public class PushPayloadTest {
assertNull(payload.getRef());
assertEquals(0, payload.getSize());
assertNull(payload.getCommits());
+ assertNull(payload.getBefore());
}
/**
@@ -49,5 +50,6 @@ public class PushPayloadTest {
assertEquals("ref", payload.setRef("ref").getRef());
assertEquals(9000, payload.setSize(9000).getSize());
assertEquals(commits, payload.setCommits(commits).getCommits());
+ assertEquals("a1b2", payload.setBefore("a1b2").getBefore());
}
}
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/event/PushPayload.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/event/PushPayload.java
index 069e0f48..e1315c7b 100644
--- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/event/PushPayload.java
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/event/PushPayload.java
@@ -22,6 +22,8 @@ public class PushPayload extends EventPayload implements Serializable {
private static final long serialVersionUID = -1542484898531583478L;
+ private String before;
+
private String head;
private String ref;
@@ -31,6 +33,22 @@ public class PushPayload extends EventPayload implements Serializable {
private List<Commit> commits;
/**
+ * @return before
+ */
+ public String getBefore() {
+ return before;
+ }
+
+ /**
+ * @param before
+ * @return this payload
+ */
+ public PushPayload setBefore(String before) {
+ this.before = before;
+ return this;
+ }
+
+ /**
* @return head
*/
public String getHead() {

Back to the top