Skip to content

Commit

Permalink
🐛 Do not try to push fixes, if there are none
Browse files Browse the repository at this point in the history
  • Loading branch information
tiulpin committed Jul 18, 2023
1 parent a3d8799 commit ef55588
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion scan/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69220,7 +69220,12 @@ var require_utils8 = __commonJS({
yield git(["reset", "--hard", `origin/${currentBranch}`]);
yield git(["stash", "apply", "stash@{0}"]);
}
yield git(["commit", "-m", commitMessage]);
const exitCode = yield git(["commit", "-m", commitMessage], {
ignoreReturnCode: true
});
if (exitCode !== 0) {
return;
}
yield git(["pull", "--rebase", "origin", currentBranch]);
if (mode === qodana_12.BRANCH) {
yield git(["push", "origin", currentBranch]);
Expand Down
8 changes: 7 additions & 1 deletion scan/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,13 @@ export async function pushQuickFixes(
await git(['reset', '--hard', `origin/${currentBranch}`])
await git(['stash', 'apply', 'stash@{0}'])
}
await git(['commit', '-m', commitMessage])
const exitCode = await git(['commit', '-m', commitMessage], {
ignoreReturnCode: true
})
if (exitCode !== 0) {
return
}

await git(['pull', '--rebase', 'origin', currentBranch])
if (mode === BRANCH) {
await git(['push', 'origin', currentBranch])
Expand Down

0 comments on commit ef55588

Please sign in to comment.