Skip to content

Commit 5acc7f0

Browse files
committed
Fix gerrit scm coverage
1 parent a64c2b3 commit 5acc7f0

File tree

1 file changed

+4
-4
lines changed
  • lib/modules/platform/gerrit

1 file changed

+4
-4
lines changed

lib/modules/platform/gerrit/scm.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,15 @@ export class GerritScm extends DefaultGitScm {
152152
}
153153
// If a change already exists, we push to the same target branch to
154154
// avoid creating a new change if the base branch has changed.
155-
// updatePr() will take care of moving the existing change to a different base
156-
// branch if needed.
157-
const changeBranch = existingChange?.branch ?? commit.baseBranch!;
155+
// updatePr() will later take care of moving the existing change to a
156+
// different base branch if needed.
158157
const pushResult = await git.pushCommit({
159158
sourceRef: commit.branchName,
160-
targetRef: `refs/for/${changeBranch}`,
159+
targetRef: `refs/for/${existingChange.branch}`,
161160
files: commit.files,
162161
pushOptions,
163162
});
163+
/* v8 ignore else -- should never happen */
164164
if (pushResult) {
165165
return commitSha;
166166
}

0 commit comments

Comments
 (0)