return branch for git & hg for correct redirect

This commit is contained in:
Eduard Heimbuch
2019-10-24 09:11:17 +02:00
parent 8a9549cf48
commit fb0eb329e5
2 changed files with 5 additions and 2 deletions

View File

@@ -64,7 +64,10 @@ public class GitModifyCommand extends AbstractGitCommand implements ModifyComman
failIfNotChanged(() -> new NoChangesMadeException(repository, ModifyWorker.this.request.getBranch()));
Optional<RevCommit> revCommit = doCommit(request.getCommitMessage(), request.getAuthor());
push();
return revCommit.orElseThrow(() -> new NoChangesMadeException(repository, ModifyWorker.this.request.getBranch())).name();
if (!revCommit.isPresent()) {
throw new NoChangesMadeException(repository, ModifyWorker.this.request.getBranch());
}
return ModifyWorker.this.request.getBranch();
}
@Override

View File

@@ -78,7 +78,7 @@ public class HgModifyCommand implements ModifyCommand {
}
CommitCommand.on(workingRepository).user(String.format("%s <%s>", request.getAuthor().getName(), request.getAuthor().getMail())).message(request.getCommitMessage()).execute();
List<Changeset> execute = pullModifyChangesToCentralRepository(request, workingCopy);
return execute.get(0).getNode();
return execute.get(0).getBranch();
} catch (ExecutionException e) {
throwInternalRepositoryException("could not execute command on repository", e);
return null;