Skip .gitreview review when unnecessary

This allows the process to run more than once in a given repo
without erroring on the already-patched .gitreview checkout.

Change-Id: Iebdf64c87d0ec497b16ce66c48c0c5e4dee5554e
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
This commit is contained in:
Dean Troyer 2018-08-10 13:25:59 -05:00
parent a57fa7a1b8
commit 2f6fa5e4e2
1 changed files with 7 additions and 5 deletions

View File

@ -57,12 +57,14 @@ function update_gitreview {
defaultbranch=$branch" defaultbranch=$branch"
echo "$grcontents" > .gitreview echo "$grcontents" > .gitreview
git add .gitreview git add .gitreview
git commit -s -m "Update .gitreview for $branch" if ! git commit -s -m "Update .gitreview for $branch"; then
git show if [[ -z $DRY_RUN ]]; then
if [[ -z $DRY_RUN ]]; then git review -t "create-${branch}"
git review -t "create-${branch}" else
echo "### skipping .gitreview submission to $branch"
fi
else else
echo "### skipping review submission to $branch" echo "### no changes required for .gitreview"
fi fi
} }