diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-04-14 12:47:44 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-04-14 12:47:45 -0700 |
commit | ee30f17805f51d372ff9c5036f1d142c167e5e34 (patch) | |
tree | f47b60cb10efd46b82c067b3e17a25004808a1c5 /submodule-config.c | |
parent | 7307dd898988c79fc687051e783b3cac8488a559 (diff) | |
parent | 2ab56603bffb7aed6ec6d2a36deddfdf49cfd5ad (diff) | |
download | git-ee30f17805f51d372ff9c5036f1d142c167e5e34.tar.gz git-ee30f17805f51d372ff9c5036f1d142c167e5e34.tar.xz |
Merge branch 'sb/submodule-path-misc-bugs' into sb/submodule-init
"git submodule" reports the paths of submodules the command
recurses into, but this was incorrect when the command was not run
from the root level of the superproject.
Any further comments? Otherwise will merge to 'next'.
* sb/submodule-path-misc-bugs: (600 commits)
t7407: make expectation as clear as possible
submodule update: test recursive path reporting from subdirectory
submodule update: align reporting path for custom command execution
submodule status: correct path handling in recursive submodules
submodule update --init: correct path handling in recursive submodules
submodule foreach: correct path display in recursive submodules
Git 2.8
Documentation: fix git-p4 AsciiDoc formatting
mingw: skip some tests in t9115 due to file name issues
t1300: fix the new --show-origin tests on Windows
t1300-repo-config: make it resilient to being run via 'sh -x'
config --show-origin: report paths with forward slashes
submodule: fix regression for deinit without submodules
l10n: pt_PT: Update and add new translations
l10n: ca.po: update translation
Git 2.8-rc4
Documentation: fix broken linkgit to git-config
Documentation: use ASCII quotation marks in git-p4
Revert "config.mak.uname: use clang for Mac OS X 10.6"
git-compat-util: st_add4: work around gcc 4.2.x compiler crash
...
Diffstat (limited to 'submodule-config.c')
-rw-r--r-- | submodule-config.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/submodule-config.c b/submodule-config.c index 9fa226919..b82d1fbb2 100644 --- a/submodule-config.c +++ b/submodule-config.c @@ -231,6 +231,35 @@ int parse_fetch_recurse_submodules_arg(const char *opt, const char *arg) return parse_fetch_recurse(opt, arg, 1); } +static int parse_push_recurse(const char *opt, const char *arg, + int die_on_error) +{ + switch (git_config_maybe_bool(opt, arg)) { + case 1: + /* There's no simple "on" value when pushing */ + if (die_on_error) + die("bad %s argument: %s", opt, arg); + else + return RECURSE_SUBMODULES_ERROR; + case 0: + return RECURSE_SUBMODULES_OFF; + default: + if (!strcmp(arg, "on-demand")) + return RECURSE_SUBMODULES_ON_DEMAND; + else if (!strcmp(arg, "check")) + return RECURSE_SUBMODULES_CHECK; + else if (die_on_error) + die("bad %s argument: %s", opt, arg); + else + return RECURSE_SUBMODULES_ERROR; + } +} + +int parse_push_recurse_submodules_arg(const char *opt, const char *arg) +{ + return parse_push_recurse(opt, arg, 1); +} + static void warn_multiple_config(const unsigned char *commit_sha1, const char *name, const char *option) { @@ -411,8 +440,8 @@ static const struct submodule *config_from(struct submodule_cache *cache, parameter.commit_sha1 = commit_sha1; parameter.gitmodules_sha1 = sha1; parameter.overwrite = 0; - git_config_from_buf(parse_config, rev.buf, config, config_size, - ¶meter); + git_config_from_mem(parse_config, "submodule-blob", rev.buf, + config, config_size, ¶meter); free(config); switch (lookup_type) { |