[PATCH 2/2] builtin/push: move flags do_push
- From
Stefan Beller <sbeller@google.com>
- Date
- Oct 4, 2016, 19:29 UTC
- Message-ID
- <20161004192910.30649-2-sbeller@google.com>
- In-Reply-To
- <20161004192910.30649-1-sbeller@google.com>
In do_push we set the flags for other options, so let's make the code more consistent and also apply the flags for recursing into submodules there.
Signed-off-by: Stefan Beller <sbeller@google.com> ---
No functional change intended, just a cleanup while we're at it. Feel free to drop if it's too much churn.
builtin/push.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/builtin/push.c b/builtin/push.c index 06fd3bd..6690301 100644 --- a/builtin/push.c +++ b/builtin/push.c @@ -388,6 +388,11 @@ static int do_push(const char *repo, int flags, " git push <name>\n")); } + if (recurse_submodules == RECURSE_SUBMODULES_CHECK) + flags |= TRANSPORT_RECURSE_SUBMODULES_CHECK; + else if (recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND) + flags |= TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND; + if (remote->mirror) flags |= (TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE); @@ -576,11 +581,6 @@ int cmd_push(int argc, const char **argv, const char *prefix) if (deleterefs && argc < 2) die(_("--delete doesn't make sense without any refs")); - if (recurse_submodules == RECURSE_SUBMODULES_CHECK) - flags |= TRANSPORT_RECURSE_SUBMODULES_CHECK; - else if (recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND) - flags |= TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND; - if (tags) add_refspec("refs/tags/*");
-- 2.10.0.129.g35f6318