diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-09-27 11:50:45 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-09-27 11:50:45 -0700 |
commit | 1958ad504befa6a09c475cc8ab9de43b359de137 (patch) | |
tree | 900dd4eebc62b31355313e18b3bd4fee4ef02600 /submodule-config.c | |
parent | 1d4361b0f344188ab5eec6dcea01f61a3a3a1670 (diff) | |
parent | 268fbcd172cdb306e8a3e7143cc16677c963d6cd (diff) | |
download | git-1958ad504befa6a09c475cc8ab9de43b359de137.tar.gz |
Sync with 2.18.1
* maint-2.18:
Git 2.18.1
Git 2.17.2
fsck: detect submodule paths starting with dash
fsck: detect submodule urls starting with dash
Git 2.16.5
Git 2.15.3
Git 2.14.5
submodule-config: ban submodule paths that start with a dash
submodule-config: ban submodule urls that start with dash
submodule--helper: use "--" to signal end of clone options
Diffstat (limited to 'submodule-config.c')
-rw-r--r-- | submodule-config.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/submodule-config.c b/submodule-config.c index fc2c41b947..0b2f1647ab 100644 --- a/submodule-config.c +++ b/submodule-config.c @@ -384,6 +384,12 @@ static void warn_multiple_config(const struct object_id *treeish_name, commit_string, name, option); } +static void warn_command_line_option(const char *var, const char *value) +{ + warning(_("ignoring '%s' which may be interpreted as" + " a command-line option: %s"), var, value); +} + struct parse_config_parameter { struct submodule_cache *cache; const struct object_id *treeish_name; @@ -409,6 +415,8 @@ static int parse_config(const char *var, const char *value, void *data) if (!strcmp(item.buf, "path")) { if (!value) ret = config_error_nonbool(var); + else if (looks_like_command_line_option(value)) + warn_command_line_option(var, value); else if (!me->overwrite && submodule->path) warn_multiple_config(me->treeish_name, submodule->name, "path"); @@ -449,6 +457,8 @@ static int parse_config(const char *var, const char *value, void *data) } else if (!strcmp(item.buf, "url")) { if (!value) { ret = config_error_nonbool(var); + } else if (looks_like_command_line_option(value)) { + warn_command_line_option(var, value); } else if (!me->overwrite && submodule->url) { warn_multiple_config(me->treeish_name, submodule->name, "url"); |