mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-01 05:09:50 +01:00
do merge commit also without diffs between branches
This commit is contained in:
@@ -214,10 +214,10 @@ class AbstractGitCommand
|
||||
}
|
||||
}
|
||||
|
||||
Optional<RevCommit> doCommit(String message, Person author) {
|
||||
Optional<RevCommit> doCommit(String message, Person author, boolean isMergeCommit) {
|
||||
Person authorToUse = determineAuthor(author);
|
||||
try {
|
||||
if (!clone.status().call().isClean()) {
|
||||
if (isMergeCommit || !clone.status().call().isClean()) {
|
||||
return of(clone.commit()
|
||||
.setAuthor(authorToUse.getName(), authorToUse.getMail())
|
||||
.setMessage(message)
|
||||
|
||||
@@ -99,7 +99,7 @@ public class GitMergeCommand extends AbstractGitCommand implements MergeCommand
|
||||
|
||||
private void doCommit() {
|
||||
logger.debug("merged branch {} into {}", toMerge, target);
|
||||
doCommit(MessageFormat.format(determineMessageTemplate(), toMerge, target), author);
|
||||
doCommit(MessageFormat.format(determineMessageTemplate(), toMerge, target), author, true);
|
||||
}
|
||||
|
||||
private String determineMessageTemplate() {
|
||||
|
||||
@@ -62,7 +62,7 @@ public class GitModifyCommand extends AbstractGitCommand implements ModifyComman
|
||||
r.execute(this);
|
||||
}
|
||||
failIfNotChanged(() -> new NoChangesMadeException(repository, ModifyWorker.this.request.getBranch()));
|
||||
Optional<RevCommit> revCommit = doCommit(request.getCommitMessage(), request.getAuthor());
|
||||
Optional<RevCommit> revCommit = doCommit(request.getCommitMessage(), request.getAuthor(), false);
|
||||
push();
|
||||
return revCommit.orElseThrow(() -> new NoChangesMadeException(repository, ModifyWorker.this.request.getBranch())).name();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user