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

View File

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