@@ -161,12 +161,6 @@ func (manifest *Manifest2822) AddEntry(entry Manifest2822Entry) error {
161
161
if entry .GitRepo == "" || entry .GitFetch == "" || entry .GitCommit == "" {
162
162
return fmt .Errorf ("Tags %q missing one of GitRepo, GitFetch, or GitCommit" , entry .TagsString ())
163
163
}
164
- if ! GitFetchRegex .MatchString (entry .GitFetch ) {
165
- return fmt .Errorf (`Tags %q has invalid GitFetch (must be "refs/heads/..." or "refs/tags/..."): %q` , entry .TagsString (), entry .GitFetch )
166
- }
167
- if ! GitCommitRegex .MatchString (entry .GitCommit ) {
168
- return fmt .Errorf (`Tags %q has invalid GitCommit (must be a commit, not a tag or ref): %q` , entry .TagsString (), entry .GitCommit )
169
- }
170
164
if invalidMaintainers := entry .InvalidMaintainers (); len (invalidMaintainers ) > 0 {
171
165
return fmt .Errorf ("Tags %q has invalid Maintainers: %q (expected format %q)" , strings .Join (invalidMaintainers , ", " ), MaintainersFormat )
172
166
}
@@ -270,6 +264,13 @@ func Parse2822(readerIn io.Reader) (*Manifest2822, error) {
270
264
return nil , err
271
265
}
272
266
267
+ if ! GitFetchRegex .MatchString (entry .GitFetch ) {
268
+ return fmt .Errorf (`Tags %q has invalid GitFetch (must be "refs/heads/..." or "refs/tags/..."): %q` , entry .TagsString (), entry .GitFetch )
269
+ }
270
+ if ! GitCommitRegex .MatchString (entry .GitCommit ) {
271
+ return fmt .Errorf (`Tags %q has invalid GitCommit (must be a commit, not a tag or ref): %q` , entry .TagsString (), entry .GitCommit )
272
+ }
273
+
273
274
err = manifest .AddEntry (entry )
274
275
if err != nil {
275
276
return nil , err
0 commit comments