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>
This commit is contained in:
parent
4d68932004
commit
f22a17e8da
@ -238,15 +238,7 @@ cmd_add()
|
|||||||
die "'$path' already exists and is not a valid git repo"
|
die "'$path' already exists and is not a valid git repo"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$repo" in
|
git config submodule."$path".url "$realrepo"
|
||||||
./*|../*)
|
|
||||||
url=$(resolve_relative_url "$repo") || exit
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
url="$repo"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
git config submodule."$path".url "$url"
|
|
||||||
else
|
else
|
||||||
|
|
||||||
module_clone "$path" "$realrepo" "$reference" || exit
|
module_clone "$path" "$realrepo" "$reference" || exit
|
||||||
|
Loading…
Reference in New Issue
Block a user