Skip to content

Commit

Permalink
Merge pull request #105 from infosiftr/explicit-full-gitcommit
Browse files Browse the repository at this point in the history
Enforce that `GitCommit` must be a *full* commit hash
  • Loading branch information
yosifkit authored Aug 13, 2024
2 parents 63bf7cf + 5f27132 commit 7afe152
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion manifest/rfc2822.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

var (
GitCommitRegex = regexp.MustCompile(`^[0-9a-f]{1,64}$`)
GitCommitRegex = regexp.MustCompile(`^([0-9a-f]{40}|[0-9a-f]{64})$`)
GitFetchRegex = regexp.MustCompile(`^refs/(heads|tags)/[^*?:]+$`)

// https://github.com/docker/distribution/blob/v2.7.1/reference/regexp.go#L37
Expand Down

0 comments on commit 7afe152

Please sign in to comment.