diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-03-25 13:07:47 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-03-25 13:07:47 -0700 |
commit | de49261b050d9cd8ec73842356077bc5b606640f (patch) | |
tree | aff75b1af189d2c3d2dffe6d5d3ba6f2f812ce08 /fsck.c | |
parent | 274b9cc25322d9ee79aa8e6d4e86f0ffe5ced925 (diff) | |
parent | 67b0a24910fbb23c8f5e7a2c61c339818bc68296 (diff) | |
download | git-de49261b050d9cd8ec73842356077bc5b606640f.tar.gz |
Git 2.26.1v2.26.1
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, |