fix: Make git push operation atomic (#32777)
This commit is contained in:
parent
97e3791d3a
commit
3b45db6df6
|
|
@ -225,6 +225,7 @@ public class GitExecutorCEImpl implements GitExecutor {
|
|||
|
||||
StringBuilder result = new StringBuilder("Pushed successfully with status : ");
|
||||
git.push()
|
||||
.setAtomic(true)
|
||||
.setTransportConfigCallback(transportConfigCallback)
|
||||
.setRemote(remoteUrl)
|
||||
.call()
|
||||
|
|
|
|||
|
|
@ -3077,11 +3077,11 @@ public class GitServiceCEImpl implements GitServiceCE {
|
|||
auth.getPublicKey(),
|
||||
auth.getPrivateKey(),
|
||||
gitArtifactMetadata.getBranchName())
|
||||
.map(pushResult -> {
|
||||
.flatMap(pushResult -> {
|
||||
if (pushResult.contains("REJECTED")) {
|
||||
throw new AppsmithException(AppsmithError.GIT_UPSTREAM_CHANGES);
|
||||
return Mono.error(new AppsmithException(AppsmithError.GIT_UPSTREAM_CHANGES));
|
||||
}
|
||||
return pushResult;
|
||||
return Mono.just(pushResult);
|
||||
}));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user