Skip to content

An open-source, faster Devin alternative

TypeScript

Reject blank repository refs

Igor Zalutski026886883e83
diff --git a/sdks/flue/src/repo.test.ts b/sdks/flue/src/repo.test.ts
index 9636b813..e6af11c9 100644
--- a/sdks/flue/src/repo.test.ts
+++ b/sdks/flue/src/repo.test.ts
@@ -93,6 +93,12 @@ describe("ocRepoTools contract", () => {
ref: "x".repeat(256),
}).success,
).toBe(false);
+ expect(
+ v.safeParse(add.input, {
+ repository: "owner/repo",
+ ref: " \t ",
+ }).success,
+ ).toBe(false);
const publish = tool("github_publish_pull_request");
expect(
diff --git a/sdks/flue/src/repo.ts b/sdks/flue/src/repo.ts
index 0142589d..8cba61bc 100644
--- a/sdks/flue/src/repo.ts
+++ b/sdks/flue/src/repo.ts
@@ -98,6 +98,7 @@ const RefSchema = v.pipe(
v.string(),
v.minLength(1),
v.maxLength(255),
+ v.check((ref) => ref.trim().length > 0, "ref cannot be blank"),
);
const PullRequestBaseSchema = v.pipe(