mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 23:45:44 +01:00
return changesetId for git & hg
This commit is contained in:
@@ -64,10 +64,7 @@ public class GitModifyCommand extends AbstractGitCommand implements ModifyComman
|
|||||||
failIfNotChanged(() -> new NoChangesMadeException(repository, ModifyWorker.this.request.getBranch()));
|
failIfNotChanged(() -> new NoChangesMadeException(repository, ModifyWorker.this.request.getBranch()));
|
||||||
Optional<RevCommit> revCommit = doCommit(request.getCommitMessage(), request.getAuthor());
|
Optional<RevCommit> revCommit = doCommit(request.getCommitMessage(), request.getAuthor());
|
||||||
push();
|
push();
|
||||||
if (!revCommit.isPresent()) {
|
return revCommit.orElseThrow(() -> new NoChangesMadeException(repository, ModifyWorker.this.request.getBranch())).name();
|
||||||
throw new NoChangesMadeException(repository, ModifyWorker.this.request.getBranch());
|
|
||||||
}
|
|
||||||
return ModifyWorker.this.request.getBranch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -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();
|
CommitCommand.on(workingRepository).user(String.format("%s <%s>", request.getAuthor().getName(), request.getAuthor().getMail())).message(request.getCommitMessage()).execute();
|
||||||
List<Changeset> execute = pullModifyChangesToCentralRepository(request, workingCopy);
|
List<Changeset> execute = pullModifyChangesToCentralRepository(request, workingCopy);
|
||||||
return execute.get(0).getBranch();
|
return execute.get(0).getNode();
|
||||||
} catch (ExecutionException e) {
|
} catch (ExecutionException e) {
|
||||||
throwInternalRepositoryException("could not execute command on repository", e);
|
throwInternalRepositoryException("could not execute command on repository", e);
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user