summaryrefslogtreecommitdiff
path: root/builtin/push.c
diff options
context:
space:
mode:
authorHeiko Voigt <hvoigt@hvoigt.net>2012-02-13 10:30:08 +0100
committerJunio C Hamano <gitster@pobox.com>2012-02-13 22:41:27 -0800
commit968bbf04a2583e309f2f42c7ec4458f1478567db (patch)
tree1920a289f5ca740ee562060bcf1afac55aeff67a /builtin/push.c
parentde5cb620707324e45dd715c7a8456d3ad09eb5fb (diff)
downloadgit-hv/submodule-recurse-push.tar.gz
push: teach --recurse-submodules the on-demand optionhv/submodule-recurse-push
When using this option git will search for all submodules that have changed in the revisions to be send. It will then try to push the currently checked out branch of each submodule. This helps when a user has finished working on a change which involves submodules and just wants to push everything in one go. Signed-off-by: Fredrik Gustafsson <iveqy@iveqy.com> Mentored-by: Jens Lehmann <Jens.Lehmann@web.de> Mentored-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/push.c')
-rw-r--r--builtin/push.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/builtin/push.c b/builtin/push.c
index 35cce532f2..f2ef8dd00c 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -224,9 +224,16 @@ 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