From: Jens Lehmann Date: Mon, 6 Jun 2011 19:58:43 +0000 (+0200) Subject: submodule add: clean up duplicated code X-Git-Tag: v1.7.6.1~15^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f22a17e;p=git.git submodule add: clean up duplicated code In cmd_add() the switch statement used to resolve a relative url was present twice. Remove the second one and use the realrepo variable set by the first one (lines 194 ff.) instead. Signed-off-by: Jens Lehmann Signed-off-by: Junio C Hamano --- diff --git a/git-submodule.sh b/git-submodule.sh index 0c984a898..32cb05443 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -238,15 +238,7 @@ cmd_add() 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" + git config submodule."$path".url "$realrepo" else module_clone "$path" "$realrepo" "$reference" || exit