aboutsummaryrefslogtreecommitdiff
path: root/builtin/push.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-04-24 14:40:20 -0700
committerJunio C Hamano <gitster@pobox.com>2012-04-24 14:40:20 -0700
commit419f2ecf7894726773f7ea5620741ce8ec60e553 (patch)
treed09b87885f64fa960dcb2cbb155da8354190f399 /builtin/push.c
parent8c3a534c506bceb4981266e0c5db2918bb067da8 (diff)
parenteb21c732d6b642a8f33abd69071a95de01d5061b (diff)
downloadgit-419f2ecf7894726773f7ea5620741ce8ec60e553.tar.gz
git-419f2ecf7894726773f7ea5620741ce8ec60e553.tar.xz
Merge branch 'hv/submodule-recurse-push'
"git push --recurse-submodules" learns to optionally look into the histories of submodules bound to the superproject and push them out. By Heiko Voigt * hv/submodule-recurse-push: push: teach --recurse-submodules the on-demand option Refactor submodule push check to use string list instead of integer Teach revision walking machinery to walk multiple times sequencially
Diffstat (limited to 'builtin/push.c')
-rw-r--r--builtin/push.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/builtin/push.c b/builtin/push.c
index 693671315..19c40d7a5 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -284,13 +284,21 @@ static int option_parse_recurse_submodules(const struct option *opt,
const char *arg, int unset)
{
int *flags = opt->value;
+
+ if (*flags & (TRANSPORT_RECURSE_SUBMODULES_CHECK |
+ TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND))
+ die("%s can only be used once.", opt->long_name);
+
if (arg) {
if (!strcmp(arg, "check"))
*flags |= TRANSPORT_RECURSE_SUBMODULES_CHECK;
+ else if (!strcmp(arg, "on-demand"))
+ *flags |= TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND;
else
die("bad %s argument: %s", opt->long_name, arg);
} else
- die("option %s needs an argument (check)", opt->long_name);
+ die("option %s needs an argument (check|on-demand)",
+ opt->long_name);
return 0;
}