Skip to content

Commit

Permalink
create branch name validation message (#3374)
Browse files Browse the repository at this point in the history
* create branch name validation message
  • Loading branch information
eden-ohana authored May 22, 2022
1 parent a95295d commit f14b220
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/catalog/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@ func (c *Catalog) CreateBranch(ctx context.Context, repository string, branch st
{Name: "branch", Value: branchID, Fn: graveler.ValidateBranchID},
{Name: "ref", Value: sourceRef, Fn: graveler.ValidateRef},
}); err != nil {
if errors.Is(err, graveler.ErrInvalidBranchID) {
return nil, fmt.Errorf("%w: branch id must consist of letters, digits, underscores and dashes, and cannot start with a dash", err)
}
return nil, err
}
newBranch, err := c.Store.CreateBranch(ctx, repositoryID, branchID, sourceRef)
Expand Down

0 comments on commit f14b220

Please sign in to comment.