Skip to content

Commit

Permalink
Merge pull request #94 from ashwanthkumar/fix-merge-commits
Browse files Browse the repository at this point in the history
Fixes #71
  • Loading branch information
ashwanthkumar authored Feb 27, 2017
2 parents d9af12f + fc8df33 commit cd2d0fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<dependency>
<groupId>in.ashwanthkumar</groupId>
<artifactId>git-cmd</artifactId>
<version>1.1</version>
<version>1.2</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import in.ashwanthkumar.gocd.github.util.GitFactory;
import in.ashwanthkumar.gocd.github.util.GitFolderFactory;
import in.ashwanthkumar.gocd.github.util.JSONUtils;
import in.ashwanthkumar.utils.collections.Lists;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;

Expand Down Expand Up @@ -292,6 +293,10 @@ GoPluginApiResponse handleLatestRevisionSince(GoPluginApiRequest goPluginApiRequ
for (String branch : newerRevisions.keySet()) {
String latestSHA = newerRevisions.get(branch);
Revision revision = git.getDetailsForRevision(latestSHA);
// patch for building merge commits
if (revision.isMergeCommit() && ListUtil.isEmpty(revision.getModifiedFiles())) {
revision.setModifiedFiles(Lists.of(new ModifiedFile("/dev/null", "deleted")));
}

Map<String, Object> revisionMap = getRevisionMap(gitConfig, branch, revision);
revisions.add(revisionMap);
Expand Down

0 comments on commit cd2d0fa

Please sign in to comment.