diff --git a/vendorsetup.sh b/vendorsetup.sh index ba4ab7db18e7bf1da793cd97a3fb23448cafd53c..839f3b7ada64c17e2b7cd6ff9457e37e6e2f0f23 100644 --- a/vendorsetup.sh +++ b/vendorsetup.sh @@ -148,6 +148,14 @@ __patch_tree() ( set -e if branch ${PRJ} ; then + if [[ -n $(git status --porcelain) ]]; then + if [[ $1 != "force" ]]; then + echo "ERROR: You have uncommited changes in ${PRJ}" + echo "You may force overwriting these changes" + echo "with |source build/envsetup.sh force|" + exit 1 + fi + fi # Ensure the project is clean before applying patches to it git reset --hard HEAD > /dev/null git clean -dfx @@ -222,6 +230,7 @@ if [[ -z $1 ]]; then else case $1 in clean) __abandon_tree ;; + force) __patch_tree force ;; np) echo "Skipping patch tree step...";; *) [[ -z "$PS1" ]] && __patch_tree || echo Error: Unknown command: $1 esac