diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-03-17 18:12:01 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-03-17 18:12:01 -0700 |
commit | 67b0a24910fbb23c8f5e7a2c61c339818bc68296 (patch) | |
tree | cfb499c09dd5d0310006062e1e361c42d0045283 /fsck.c | |
parent | 0822e66b5d49d0de1aa767b38785e42de05eaf40 (diff) | |
parent | 506223f9c5c8956f895f0342e4a6d4244b5fa570 (diff) | |
download | git-67b0a24910fbb23c8f5e7a2c61c339818bc68296.tar.gz |
Git 2.25.3v2.25.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fsck.c')
-rw-r--r-- | fsck.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -15,6 +15,7 @@ #include "packfile.h" #include "submodule-config.h" #include "config.h" +#include "credential.h" #include "help.h" static struct oidset gitmodules_found = OIDSET_INIT; @@ -910,6 +911,19 @@ done: return ret; } +static int check_submodule_url(const char *url) +{ + struct credential c = CREDENTIAL_INIT; + int ret; + + if (looks_like_command_line_option(url)) + return -1; + + ret = credential_from_url_gently(&c, url, 1); + credential_clear(&c); + return ret; +} + struct fsck_gitmodules_data { const struct object_id *oid; struct fsck_options *options; @@ -935,7 +949,7 @@ static int fsck_gitmodules_fn(const char *var, const char *value, void *vdata) "disallowed submodule name: %s", name); if (!strcmp(key, "url") && value && - looks_like_command_line_option(value)) + check_submodule_url(value) < 0) data->ret |= report(data->options, data->oid, OBJ_BLOB, FSCK_MSG_GITMODULES_URL, |