diff options
author | Mike Frysinger <vapier@google.com> | 2022-05-20 12:52:33 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2022-05-21 19:19:44 +0000 |
commit | 3a0a145b0ec52dff88b021c5937925f25294a10f (patch) | |
tree | cd7e2f5fdf821485d19bfdb6507c2fb098b0b5f1 /subcmds/upload.py | |
parent | 74737da1ab9b5a25c38616d563a973af267277f7 (diff) | |
download | git-repo-3a0a145b0ec52dff88b021c5937925f25294a10f.tar.gz |
upload: move label validation to core function
This way we know we don't need to encode the labels.
Change-Id: Ib83ed8f4ed05f00b9d2d06a9dd3f304e4443430e
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/337518
Tested-by: Mike Frysinger <vapier@google.com>
Reviewed-by: LaMont Jones <lamontjones@google.com>
Diffstat (limited to 'subcmds/upload.py')
-rw-r--r-- | subcmds/upload.py | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py index ef3d8e9d..20b8fe5d 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
@@ -421,12 +421,6 @@ Gerrit Code Review: https://www.gerritcodereview.com/ | |||
421 | labels = set(_ExpandCommaList(branch.project.config.GetString(key))) | 421 | labels = set(_ExpandCommaList(branch.project.config.GetString(key))) |
422 | for label in opt.labels: | 422 | for label in opt.labels: |
423 | labels.update(_ExpandCommaList(label)) | 423 | labels.update(_ExpandCommaList(label)) |
424 | # Basic sanity check on label syntax. | ||
425 | for label in labels: | ||
426 | if not re.match(r'^.+[+-][0-9]+$', label): | ||
427 | print('repo: error: invalid label syntax "%s": labels use forms ' | ||
428 | 'like CodeReview+1 or Verified-1' % (label,), file=sys.stderr) | ||
429 | sys.exit(1) | ||
430 | 424 | ||
431 | # Handle e-mail notifications. | 425 | # Handle e-mail notifications. |
432 | if opt.notify is False: | 426 | if opt.notify is False: |