Skip to content

Commit

Permalink
Add test of JENKINS-22343 - JGit.showRevision is empty for first commit
Browse files Browse the repository at this point in the history
The failing test is marked with @NotImplementedInJGit.  Those markers
indicate gaps in the JGit implementation compared to the CliGit
implementation.
  • Loading branch information
MarkEWaite committed Mar 28, 2014
1 parent 99be4ca commit 76ca2ae
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestCase.java
Expand Up @@ -1784,6 +1784,28 @@ public boolean apply(String detail) {
assertTrue(commits.contains("commit 51de9eda47ca8dcf03b2af58dfff7355585f0d0c"));
}

/* Is implemented in JGit, but returns no results. Temporarily
* marking this test as not implemented in JGit so that its
* failure does not distract from other development.
*/
@Bug(22343)
@NotImplementedInJGit
public void test_show_revision_for_first_commit() throws Exception {
w.init();
w.touch("a");
w.git.add("a");
w.git.commit("first");
ObjectId first = w.head();
List<String> revisionDetails = w.git.showRevision(first);
Collection<String> commits = Collections2.filter(revisionDetails, new Predicate<String>() {
public boolean apply(String detail) {
return detail.startsWith("commit ");
}
});
assertTrue("Commits '" + commits + "' missing " + first.getName(), commits.contains("commit " + first.getName()));
assertEquals("Commits '" + commits + "' wrong size", 1, commits.size());
}

public void test_describe() throws Exception {
w.init();
w.commitEmpty("first");
Expand Down

0 comments on commit 76ca2ae

Please sign in to comment.