aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-submodule.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index c2ce2fbe8..9228f56be 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -172,6 +172,16 @@ cmd_add()
else
die "'$path' already exists and is not a valid git repo"
fi
+
+ case "$repo" in
+ ./*|../*)
+ url=$(resolve_relative_url "$repo") || exit
+ ;;
+ *)
+ url="$repo"
+ ;;
+ esac
+ git config submodule."$path".url "$url"
else
module_clone "$path" "$realrepo" || exit