fixed missing checkout call for GitBranchCommand

This commit is contained in:
Sebastian Sdorra
2019-04-17 13:51:13 +02:00
parent 311eba2f9f
commit dd39c6b535
2 changed files with 22 additions and 1 deletions

View File

@@ -61,7 +61,7 @@ public class GitBranchCommand extends AbstractGitCommand implements BranchComman
try (WorkingCopy<org.eclipse.jgit.lib.Repository> workingCopy = workdirFactory.createWorkingCopy(context)) {
Git clone = new Git(workingCopy.getWorkingRepository());
if (request.getParentBranch() != null) {
clone.checkout().setName(request.getParentBranch());
clone.checkout().setName("origin/" + request.getParentBranch()).call();
}
Ref ref = clone.branchCreate().setName(request.getNewBranch()).call();
Iterable<PushResult> call = clone.push().add(request.getNewBranch()).call();