Skip to content

Commit f22a17e

Browse files
jlehmanngitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4d68932 commit f22a17e

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

git-submodule.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,7 @@ cmd_add()
238238
die "'$path' already exists and is not a valid git repo"
239239
fi
240240

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"
250242
else
251243

252244
module_clone "$path" "$realrepo" "$reference" || exit

0 commit comments

Comments
 (0)