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>
Jens Lehmann committed
Jun 6, 2011 at 21:58 UTC
f22a17e8da25a043950a13f11035930922bb86e7
1 file changed
+1
-9
git-submodule.sh
+1
-9
@@ -238,15 +238,7 @@ cmd_add()
238
die "'$path' already exists and is not a valid git repo"
239
fi
240
241
- case "$repo" in
242
- ./*|../*)
243
- url=$(resolve_relative_url "$repo") || exit
244
- ;;
245
- *)
246
- url="$repo"
247
- ;;
248
- esac
249
- git config submodule."$path".url "$url"
241
+ git config submodule."$path".url "$realrepo"
242
else
243
244
module_clone "$path" "$realrepo" "$reference" || exit