aboutsummaryrefslogtreecommitdiff
path: root/git-submodule-move-git-dir
diff options
context:
space:
mode:
Diffstat (limited to 'git-submodule-move-git-dir')
-rwxr-xr-xgit-submodule-move-git-dir9
1 files changed, 5 insertions, 4 deletions
diff --git a/git-submodule-move-git-dir b/git-submodule-move-git-dir
index 8c28e66..44fd054 100755
--- a/git-submodule-move-git-dir
+++ b/git-submodule-move-git-dir
@@ -30,14 +30,15 @@ elif [ -d "$MODULE/.git" ]; then
elif [ ! -e ".git" ]; then
echo "please run this command in the top-level repository folder"
exit 1
-fi
-
-if [ ! -f "$MODULE/.git" ]; then
+elif [ ! -f "$MODULE/.git" ]; then
echo "$BASENAME: not a file, or file not found: $MODULE/.git"
exit 1
+elif [ -e "$MODULE/.gitmodules" ]; then
+ echo "$BASENAME: this repository has submodules; use git-submodule-move-all-git-dirs instead"
+ exit 1
fi
-# Additional parameters
+# Setup
RELATIVE_REPO_DIR="$(cd $MODULE &> /dev/null && cd `cut -d : -f 2 .git` &> /dev/null && pwd)"
REPO_DIR="`pwd`"
MODULE_DIR="`cd $MODULE &> /dev/null && pwd`"