Created
January 21, 2022 01:49
-
-
Save GMNGeoffrey/d2fe784745947fb54de2bf32acc362bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copyright 2022 Google LLC. | |
# SPDX-License-Identifier: Apache-2.0 | |
set -e | |
set -o pipefail | |
if [[ -n "$(git status --porcelain --ignore-submodules)" ]]; then | |
echo "Working directory not clean" | |
git status | |
exit 1 | |
fi | |
git checkout "${1?}" | |
git pull upstream "${1?}" --ff-only | |
git submodule update --init | |
if [[ -n "$(git status --porcelain --ignore-submodules=dirty)" ]]; then | |
echo "Working directory not clean after update" | |
git status | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment