mirror of
https://github.com/kiegroup/git-backporting.git
synced 2025-05-11 03:03:43 +00:00
fix: auto-no-squash inference for GitLab (#140)
When a GitLab MR is not squashed, `squash_commit_sha` will be `null`, not `undefined`. Update `inferSquash()` to account for this.
This commit is contained in:
parent
c3daf80306
commit
b4d0481c56
8 changed files with 257 additions and 8 deletions
4
dist/cli/index.js
vendored
4
dist/cli/index.js
vendored
|
@ -733,7 +733,7 @@ exports.inferGitApiUrl = inferGitApiUrl;
|
|||
/**
|
||||
* Infer the value of the squash option
|
||||
* @param open true if the pull/merge request is still open
|
||||
* @param squash_commit undefined if the pull/merge request was merged, the sha of the squashed commit if it was squashed
|
||||
* @param squash_commit undefined or null if the pull/merge request was merged, the sha of the squashed commit if it was squashed
|
||||
* @returns true if a single commit must be cherry-picked, false if all merged commits must be cherry-picked
|
||||
*/
|
||||
const inferSquash = (open, squash_commit) => {
|
||||
|
@ -743,7 +743,7 @@ const inferSquash = (open, squash_commit) => {
|
|||
return false;
|
||||
}
|
||||
else {
|
||||
if (squash_commit !== undefined) {
|
||||
if (squash_commit) {
|
||||
logger.debug(`cherry-pick the squashed commit ${squash_commit}`);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue