Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShourya Shukla <shouryashukla.oo@gmail.com>2020-05-08 09:21:36 +0300
committerJunio C Hamano <gitster@pobox.com>2020-05-08 19:17:55 +0300
commit6417cf9c21e9b3f450cd78352d19f43a4dd5a495 (patch)
treed3a849f3982bfa741d354efb390d859b4c6cb872 /git-submodule.sh
parent07d8ea56f2ecb64b75b92264770c0a664231ce17 (diff)
submodule: port subcommand 'set-url' from shell to C
Convert submodule subcommand 'set-url' to a builtin. Port 'set-url' to 'submodule--helper.c' and call the latter via 'git-submodule.sh'. Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh22
1 files changed, 1 insertions, 21 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 08e0439df0..39ebdf25b5 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -805,27 +805,7 @@ cmd_set_url() {
shift
done
- if test $# -ne 2
- then
- usage
- fi
-
- # we can't use `git submodule--helper name` here because internally, it
- # hashes the path so a trailing slash could lead to an unintentional no match
- name="$(git submodule--helper list "$1" | cut -f2)"
- if test -z "$name"
- then
- exit 1
- fi
-
- url="$2"
- if test -z "$url"
- then
- exit 1
- fi
-
- git submodule--helper config submodule."$name".url "$url"
- git submodule--helper sync ${GIT_QUIET:+--quiet} "$name"
+ git ${wt_prefix:+-C "$wt_prefix"} ${prefix:+--super-prefix "$prefix"} submodule--helper set-url ${GIT_QUIET:+--quiet} -- "$@"
}
#