Skip to content

Commit

Permalink
Fix branch name validation in create branch modal
Browse files Browse the repository at this point in the history
  • Loading branch information
jaclarke committed Jul 4, 2024
1 parent da2b940 commit d80abd7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion shared/studio/components/modals/createBranch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,17 @@ export default function CreateBranchModal({
{...register("branchName", {
required: "Database name is required",
pattern: {
value: /^[A-Za-z]\w*$/,
value: /^[^@].*$/,
message: legacy
? "Invalid database name"
: "Invalid branch name",
},
validate: (v) =>
v.startsWith("__") && v.endsWith("__")
? legacy
? "Invalid database name"
: "Invalid branch name"
: true,
})}
error={formState.errors.branchName?.message}
/>
Expand Down

0 comments on commit d80abd7

Please sign in to comment.