intel_sync_upsteam: Add option '--external` to not skip validation

This patch adds an option `--external` to not skip validation while
pushing to the staging repo.

Skipping validation checks caused gerrit permission issue where the
partner accounts aren't able to push patches.

Error message on partner accounts:
"https://chrome-internal.googlesource.com/chromeos/third_party/intel-
fsp/edk2-intelcollab
 ! [remote rejected]       HEAD -> staging/-PTL.3103.05 (prohibited by
 Gerrit: not permitted: skip validation)"

This patch also refactors the parameter count check to throw error
whenever the arguments are less than 4 instead of not equal to 4.

BUG=b:408320898
TEST=able to push uprev changes for fsp,edk2,edk2-platform for ptl w/
and w/o '--external' flag. example:
- for partner/external accounts:
intel_sync_upstream.sh ptl fsp 'PTL.3103.05' 406375765 --external
- for internal/googlers accounts:
intel_sync_upstream.sh ptl fsp 'PTL.3103.05' 406375765

Change-Id: Ibd8655aaaff3662f5116914454e2decb33a809ae
Signed-off-by: Jayvik Desai <jayvik@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/6446281
Reviewed-by: Kapil Porwal <kapilporwal@chromium.org>
Reviewed-by: Subrata Banik <subratabanik@chromium.org>
1 file changed