(refs #2)Add NO_FF option to merging pull request.

This commit is contained in:
takezoe
2013-07-29 02:10:21 +09:00
parent f317d74bb4
commit 7a8958741d

View File

@@ -11,6 +11,8 @@ import org.eclipse.jgit.transport.RefSpec
import org.apache.commons.io.FileUtils
import scala.collection.JavaConverters._
import service.RepositoryService.RepositoryTreeNode
import org.eclipse.jgit.lib.PersonIdent
import org.eclipse.jgit.api.MergeCommand.FastForwardMode
class PullRequestsController extends PullRequestsControllerBase
with RepositoryService with AccountService with IssuesService with PullRequestService with MilestonesService with ActivityService
@@ -108,7 +110,8 @@ trait PullRequestsControllerBase extends ControllerBase {
val result = git.merge
.include(git.getRepository.resolve("FETCH_HEAD"))
.setCommit(false).call
.setFastForward(FastForwardMode.NO_FF)
.setCommit(true).call
if(result.getConflicts != null){
throw new RuntimeException("This pull request can't merge automatically.")