summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 0a3e1465e3..b0b6ccbe72 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -60,8 +60,12 @@ resolve_relative_url ()
*:*|/*)
is_relative=
;;
+ ./*|../*)
+ is_relative=t
+ ;;
*)
is_relative=t
+ remoteurl="./$remoteurl"
;;
esac
@@ -79,7 +83,12 @@ resolve_relative_url ()
sep=:
;;
*)
- die "$(eval_gettext "cannot strip one component off url '\$remoteurl'")"
+ if test -z "$is_relative" || test "." = "$remoteurl"
+ then
+ die "$(eval_gettext "cannot strip one component off url '\$remoteurl'")"
+ else
+ remoteurl=.
+ fi
;;
esac
;;
@@ -90,7 +99,8 @@ resolve_relative_url ()
break;;
esac
done
- echo "${is_relative:+${up_path}}$remoteurl$sep${url%/}"
+ remoteurl="$remoteurl$sep${url%/}"
+ echo "${is_relative:+${up_path}}${remoteurl#./}"
}
#