diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-03-03 15:17:12 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-03-03 15:17:12 +0900 |
commit | 1866b086723a206a29d226a2b5dddcf7c43babfa (patch) | |
tree | c6c67bb426288e38a9c0aa4a297a410bed6399ab /fsck.c | |
parent | a9fc46caa4ea41274bd7692ae8b7138a0b6cc121 (diff) | |
download | git-1866b086723a206a29d226a2b5dddcf7c43babfa.tar.gz git-1866b086723a206a29d226a2b5dddcf7c43babfa.tar.bz2 git-1866b086723a206a29d226a2b5dddcf7c43babfa.zip |
Imported Upstream version 2.25.3upstream/2.25.3
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, |