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