Skip to content

Commit

Permalink
submodule add: clean up duplicated code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Lehmann authored and Junio C Hamano committed Jun 6, 2011
1 parent 4d68932 commit f22a17e
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions git-submodule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f22a17e

Please sign in to comment.