mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-02 11:35:57 +01:00
implement requested review changes
This commit is contained in:
@@ -63,7 +63,7 @@ public class GitMergeRebase extends GitMergeStrategy {
|
||||
.setUpstream(targetBranch)
|
||||
.call();
|
||||
} catch (GitAPIException e) {
|
||||
throw new InternalRepositoryException(getContext().getRepository(), "could not merge branch " + branchToMerge + " into " + targetBranch, e);
|
||||
throw new InternalRepositoryException(getContext().getRepository(), "could not rebase branch " + branchToMerge + " onto " + targetBranch, e);
|
||||
}
|
||||
|
||||
if (result.getStatus().isSuccessful()) {
|
||||
@@ -84,7 +84,6 @@ public class GitMergeRebase extends GitMergeStrategy {
|
||||
getClone()
|
||||
.merge()
|
||||
.setFastForward(MergeCommand.FastForwardMode.FF_ONLY)
|
||||
.setCommit(false) // we want to set the author manually
|
||||
.include(branchToMerge, sourceRevision)
|
||||
.call();
|
||||
push();
|
||||
|
||||
@@ -496,7 +496,7 @@ public class GitMergeCommandTest extends AbstractGitCommandTestBase {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldRejectRebaseMergeIfBranchCannotBeRebased() {
|
||||
public void shouldRejectRebaseMergeIfBranchCannotBeRebased() throws IOException, GitAPIException {
|
||||
GitMergeCommand command = createCommand();
|
||||
MergeCommandRequest request = new MergeCommandRequest();
|
||||
request.setTargetBranch("master");
|
||||
@@ -507,6 +507,10 @@ public class GitMergeCommandTest extends AbstractGitCommandTestBase {
|
||||
MergeCommandResult mergeCommandResult = command.merge(request);
|
||||
|
||||
assertThat(mergeCommandResult.isSuccess()).isFalse();
|
||||
Repository repository = createContext().open();
|
||||
Iterable<RevCommit> commits = new Git(repository).log().add(repository.resolve("master")).setMaxCount(1).call();
|
||||
RevCommit headCommit = commits.iterator().next();
|
||||
assertThat(headCommit.getName()).isEqualTo("fcd0ef1831e4002ac43ea539f4094334c79ea9ec");
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user