diff --git a/vendorsetup.sh b/vendorsetup.sh index ba4ab7db18e7bf1da793cd97a3fb23448cafd53c..71851e2dc33b285c4853d765af5441fe2d5e186d 100644 --- a/vendorsetup.sh +++ b/vendorsetup.sh @@ -148,6 +148,14 @@ __patch_tree() ( set -e if branch ${PRJ} ; then + if [[ $1 != "force" && $(whoami) != "lnxbuild" ]]; then + if [[ -n $(git status --porcelain) ]]; 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