upload: exit non-zero when preupload hooks fail

Bug: https://crbug.com/gerrit/13159
Change-Id: Id140b619242c841223c6bc5d4aa0c37a7ce0219d
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/276294
Reviewed-by: Jonathan Nieder <jrn@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
diff --git a/subcmds/upload.py b/subcmds/upload.py
index 3dd9fd2..a886af9 100644
--- a/subcmds/upload.py
+++ b/subcmds/upload.py
@@ -596,7 +596,7 @@
           print('\nWARNING: pre-upload hooks failed, but uploading anyways.',
                 file=sys.stderr)
         else:
-          return
+          return 1
 
     if opt.reviewers:
       reviewers = _SplitEmails(opt.reviewers)