diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-09-27 11:35:43 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-09-27 11:35:43 -0700 |
commit | 424aac653acce98f1bfb7f8b7bf36361f558472d (patch) | |
tree | 760542d1cc64bfe430938ccd14d2f9a4eeecb5b5 /submodule-config.c | |
parent | a42a58d7b62cc1d6301440e81a83feed9d7c118c (diff) | |
parent | 924c623e1c71b98da608f980a97f9730c021ba44 (diff) | |
download | git-424aac653acce98f1bfb7f8b7bf36361f558472d.tar.gz |
Sync with 2.15.3
* maint-2.15:
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 e5f4901212..3c40f1f1c5 100644 --- a/submodule-config.c +++ b/submodule-config.c @@ -383,6 +383,12 @@ static void warn_multiple_config(const unsigned char *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 unsigned char *treeish_name; @@ -408,6 +414,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"); @@ -448,6 +456,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"); |