From c1eefcd5af4f333f6f122bd8874f7ee0b69d8ef0 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Thu, 14 Nov 2013 15:08:33 +0900 Subject: [PATCH] configure: Refuse to do anything if a submodule has a dirty working tree This isn't a full fix for #522 / #835 but it prevents the unrecoverable loss of work without changing the behavior of configure generally. If configure drops committed local work, it can be recovered from the reflog. --- configure | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure b/configure index 606bb5a1a8d..98b36b87201 100755 --- a/configure +++ b/configure @@ -308,6 +308,11 @@ CFG_SELF=${CFG_SRC_DIR}$(basename $0) CFG_CONFIGURE_ARGS="$@" CFG_PATH=$PATH +if git status $CFG_SRC_DIR/src/compiler $CFG_SRC_DIR/src/support $CFG_SRC_DIR/src/platform \ + | grep -q 'modified:.*modified content'; then + err "Some submodule has a dirty working tree. See 'git status'." +fi + OPTIONS="" HELP=0 if [ "$1" = "--help" ]