Skip to content

Commit fc7f3a4

Browse files
committed
fix: use uppercase state values for Bitbucket CLI --state argument
The Bitbucket CLI expects uppercase state values (OPEN, MERGED, DECLINED, etc.) for the --state flag. toBitbucketState was returning lowercase values which would cause filtering to silently fail. Updated to return uppercase values and fixed the corresponding test assertion.
1 parent bfbc27f commit fc7f3a4

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

apps/server/src/sourceControl/BitbucketCli.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ describe("BitbucketCli.layer", () => {
141141
"--head",
142142
"feature/merged",
143143
"--state",
144-
"merged",
144+
"MERGED",
145145
"--limit",
146146
"10",
147147
"--json",

apps/server/src/sourceControl/BitbucketCli.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,13 @@ function sourceBranch(input: {
161161
function toBitbucketState(state: "open" | "closed" | "merged" | "all"): string {
162162
switch (state) {
163163
case "open":
164-
return "open";
164+
return "OPEN";
165165
case "closed":
166-
return "declined";
166+
return "DECLINED";
167167
case "merged":
168-
return "merged";
168+
return "MERGED";
169169
case "all":
170-
return "all";
170+
return "ALL";
171171
}
172172
}
173173

0 commit comments

Comments
 (0)