mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-12-23 16:59:48 +01:00
implement requested review changes
This commit is contained in:
@@ -63,7 +63,7 @@ public class GitMergeRebase extends GitMergeStrategy {
|
|||||||
.setUpstream(targetBranch)
|
.setUpstream(targetBranch)
|
||||||
.call();
|
.call();
|
||||||
} catch (GitAPIException e) {
|
} 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()) {
|
if (result.getStatus().isSuccessful()) {
|
||||||
@@ -84,7 +84,6 @@ public class GitMergeRebase extends GitMergeStrategy {
|
|||||||
getClone()
|
getClone()
|
||||||
.merge()
|
.merge()
|
||||||
.setFastForward(MergeCommand.FastForwardMode.FF_ONLY)
|
.setFastForward(MergeCommand.FastForwardMode.FF_ONLY)
|
||||||
.setCommit(false) // we want to set the author manually
|
|
||||||
.include(branchToMerge, sourceRevision)
|
.include(branchToMerge, sourceRevision)
|
||||||
.call();
|
.call();
|
||||||
push();
|
push();
|
||||||
|
|||||||
@@ -496,7 +496,7 @@ public class GitMergeCommandTest extends AbstractGitCommandTestBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void shouldRejectRebaseMergeIfBranchCannotBeRebased() {
|
public void shouldRejectRebaseMergeIfBranchCannotBeRebased() throws IOException, GitAPIException {
|
||||||
GitMergeCommand command = createCommand();
|
GitMergeCommand command = createCommand();
|
||||||
MergeCommandRequest request = new MergeCommandRequest();
|
MergeCommandRequest request = new MergeCommandRequest();
|
||||||
request.setTargetBranch("master");
|
request.setTargetBranch("master");
|
||||||
@@ -507,6 +507,10 @@ public class GitMergeCommandTest extends AbstractGitCommandTestBase {
|
|||||||
MergeCommandResult mergeCommandResult = command.merge(request);
|
MergeCommandResult mergeCommandResult = command.merge(request);
|
||||||
|
|
||||||
assertThat(mergeCommandResult.isSuccess()).isFalse();
|
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