summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2010-11-22 03:11:23 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2010-11-30 20:25:21 -0600
commitd41f1866bcb7f2b74c158bbf3ab51d10cb324e9b (patch)
treeb62a5e1db4bd78d3a07bda2aa36467aa6e6ee5b2 /bin
parent13756e658cfc7f69c22927b7b43f30ab829fedfe (diff)
simplify the determination of the bootstrap dir
Diffstat (limited to 'bin')
-rwxr-xr-xbin/mkworkdir17
1 files changed, 6 insertions, 11 deletions
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