mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-02 19:45:57 +01:00
(refs #2)Add NO_FF option to merging pull request.
This commit is contained in:
@@ -11,6 +11,8 @@ import org.eclipse.jgit.transport.RefSpec
|
|||||||
import org.apache.commons.io.FileUtils
|
import org.apache.commons.io.FileUtils
|
||||||
import scala.collection.JavaConverters._
|
import scala.collection.JavaConverters._
|
||||||
import service.RepositoryService.RepositoryTreeNode
|
import service.RepositoryService.RepositoryTreeNode
|
||||||
|
import org.eclipse.jgit.lib.PersonIdent
|
||||||
|
import org.eclipse.jgit.api.MergeCommand.FastForwardMode
|
||||||
|
|
||||||
class PullRequestsController extends PullRequestsControllerBase
|
class PullRequestsController extends PullRequestsControllerBase
|
||||||
with RepositoryService with AccountService with IssuesService with PullRequestService with MilestonesService with ActivityService
|
with RepositoryService with AccountService with IssuesService with PullRequestService with MilestonesService with ActivityService
|
||||||
@@ -108,7 +110,8 @@ trait PullRequestsControllerBase extends ControllerBase {
|
|||||||
|
|
||||||
val result = git.merge
|
val result = git.merge
|
||||||
.include(git.getRepository.resolve("FETCH_HEAD"))
|
.include(git.getRepository.resolve("FETCH_HEAD"))
|
||||||
.setCommit(false).call
|
.setFastForward(FastForwardMode.NO_FF)
|
||||||
|
.setCommit(true).call
|
||||||
|
|
||||||
if(result.getConflicts != null){
|
if(result.getConflicts != null){
|
||||||
throw new RuntimeException("This pull request can't merge automatically.")
|
throw new RuntimeException("This pull request can't merge automatically.")
|
||||||
|
|||||||
Reference in New Issue
Block a user