diff options
author | Jens Lehmann <Jens.Lehmann@web.de> | 2011-06-06 21:58:43 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-06-06 13:46:36 -0700 |
commit | f22a17e8da25a043950a13f11035930922bb86e7 (patch) | |
tree | b8fdcef7d6a5a7f55bde6e16d8f3a09a8ec47633 /git-submodule.sh | |
parent | 4d689320049e1ff3bd31e0468d6f17eeb0b7029c (diff) | |
download | git-f22a17e8da25a043950a13f11035930922bb86e7.tar.gz |
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 <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-x | git-submodule.sh | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/git-submodule.sh b/git-submodule.sh index 0c984a8983..32cb05443a 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 |