summaryrefslogtreecommitdiff
path: root/builtin/submodule--helper.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-08-31 23:17:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-09-02 16:16:23 (GMT)
commit96a28a9bc655e1804a516de864d5aada13260f50 (patch)
treed18de4342c07dfdc989d4d7b28c537c75c68efb1 /builtin/submodule--helper.c
parent85321a346b5889f5602603a300d643493901ba44 (diff)
downloadgit-96a28a9bc655e1804a516de864d5aada13260f50.zip
git-96a28a9bc655e1804a516de864d5aada13260f50.tar.gz
git-96a28a9bc655e1804a516de864d5aada13260f50.tar.bz2
submodule--helper: move "resolve-relative-url-test" to a test-tool
As its name suggests the "resolve-relative-url-test" has never been used outside of the test suite, see 63e95beb085 (submodule: port resolve_relative_url from shell to C, 2016-04-15) for its original addition. Perhaps it would make sense to drop this code entirely, as we feel that we've got enough indirect test coverage, but let's leave that question to a possible follow-up change. For now let's keep the test coverage this gives us. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Reviewed-by: Glen Choo <chooglen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/submodule--helper.c')
-rw-r--r--builtin/submodule--helper.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 0630788..246457e 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -96,28 +96,6 @@ static char *resolve_relative_url(const char *rel_url, const char *up_path, int
return resolved_url;
}
-static int resolve_relative_url_test(int argc, const char **argv, const char *prefix)
-{
- char *remoteurl, *res;
- const char *up_path, *url;
-
- if (argc != 4)
- die("resolve-relative-url-test only accepts three arguments: <up_path> <remoteurl> <url>");
-
- up_path = argv[1];
- remoteurl = xstrdup(argv[2]);
- url = argv[3];
-
- if (!strcmp(up_path, "(null)"))
- up_path = NULL;
-
- res = relative_url(remoteurl, url, up_path);
- puts(res);
- free(res);
- free(remoteurl);
- return 0;
-}
-
/* the result should be freed by the caller. */
static char *get_submodule_displaypath(const char *path, const char *prefix)
{
@@ -3273,7 +3251,6 @@ static struct cmd_struct commands[] = {
{"clone", module_clone, SUPPORT_SUPER_PREFIX},
{"add", module_add, 0},
{"update", module_update, SUPPORT_SUPER_PREFIX},
- {"resolve-relative-url-test", resolve_relative_url_test, 0},
{"foreach", module_foreach, SUPPORT_SUPER_PREFIX},
{"init", module_init, 0},
{"status", module_status, SUPPORT_SUPER_PREFIX},