Skip to content

Commit

Permalink
Add check that working folder is clean to git-run-all-in-branches.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
iva2k committed Feb 7, 2024
1 parent 1e8d48a commit c194f92
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/git-run-all-in-branches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ function decolor() {
}

function main() {
# Check that local repo is clean
output=$(git status --untracked-files=no --porcelain 2>&1)
if [ "$?" -ne 0 ] || [ ! -z "$output" ]; then
# Working directory clean excluding untracked files
echo "Working folder is not clean. Please clean working folder and retry."
echo "$output"
return 1
else
echo "Working folder is clean."
fi

outputs=()
errors=()
for i in "${!TARGET_BRANCHES[@]}"; do
Expand Down

0 comments on commit c194f92

Please sign in to comment.