Git 2.25.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano
2020-03-17 18:12:01 -07:00
17 changed files with 155 additions and 8 deletions

16
fsck.c
View File

@@ -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,