From d41f1866bcb7f2b74c158bbf3ab51d10cb324e9b Mon Sep 17 00:00:00 2001 From: Norbert Thiebaud Date: Mon, 22 Nov 2010 03:11:23 -0600 Subject: simplify the determination of the bootstrap dir --- bin/mkworkdir | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'bin/mkworkdir') diff --git a/bin/mkworkdir b/bin/mkworkdir index 10630f83062e..9691ee1bd16e 100755 --- a/bin/mkworkdir +++ b/bin/mkworkdir @@ -57,18 +57,13 @@ done if [ -z "$BOOTSTRAP_DIR" ]; then - BOOTSTRAP_DIR=$(git rev-parse --git-dir 2>/dev/null) || die "Cannot use the current working directory as implicit source: Not a git repository" - - case "$BOOTSTRAP_DIR" in - .git) - BOOTSTRAP_DIR="$(pwd)" - ;; - .) - cd .. && BOOTSTRAP_DIR=$(pwd) - ;; - esac + BOOTSTRAP_DIR=$(git rev-parse --show-toplevel 2>/dev/null) || die "Cannot use the current working directory as implicit source: Not a git repository" + if [ -n "$BOOTSTRAP_DIR" ] ; then + if [ "$(basename $(git config remote.origin.url))" != "bootstrap" ] ; then + die "Cannot use the current working directory as implicit source: Not a bootstrap git repository" + fi + fi fi - if [ -z "$DEST_DIR" ]; then echo "destination directory is missing." print_help $0 -- cgit