Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checkgit.sh: Added a check for local modifications #3347

Merged
merged 1 commit into from Oct 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions resources/checkgit.sh
Expand Up @@ -8,6 +8,14 @@ trap "exit 1" ERR
# and including any changes on main.
#

# Check that local copy has no modifications
GIT_MODIFIED_FILES=$(git ls-files -dm 2> /dev/null);
GIT_STAGED_FILES=$(git diff --cached --name-only 2> /dev/null);
if [ "$GIT_MODIFIED_FILES" != "" -o "$GIT_STAGED_FILES" != "" ]; then
read -p "Git has local modifications. Continue? (y|N) " yn;
if [ "$yn" != "y" ]; then exit 1; fi;
fi;

# First fetch to ensure git is up to date. Fail-fast if this fails.
git fetch;
if [[ $? -ne 0 ]]; then exit 1; fi;
Expand Down