[PATCH 2/4] git-push: squelch advice message if in --porcelain mode
- From
Larry D'Anna <larry@elder-gods.org>
- Date
- Feb 26, 2010, 19:50 UTC
- Message-ID
- <75b6d65f8028407cc1e8244a57823b3d87c520f1.1267211537.git.larry@elder-gods.org>
- In-Reply-To
- <cover.1267211537.git.larry@elder-gods.org>
By default, git-push may give the user a verbose advice message if a ref is rejected for not being a fast-forward. This patch squelches that message for --porcelain mode.
Signed-off-by: Larry D'Anna <larry@elder-gods.org> --- builtin-push.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/builtin-push.c b/builtin-push.c index 0a27072..aacba45 100644 --- a/builtin-push.c +++ b/builtin-push.c @@ -226,6 +226,11 @@ int cmd_push(int argc, const char **argv, const char *prefix) git_config(git_default_config, NULL); argc = parse_options(argc, argv, prefix, options, push_usage, 0); + if (flags & TRANSPORT_PUSH_PORCELAIN) { + /* Do not give advice messages to Porcelain scripts */ + advice_push_nonfastforward = 0; + } + if (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR)))) die("--delete is incompatible with --all, --mirror and --tags"); if (deleterefs && argc < 2)
-- 1.7.0.rc2.40.g7d8aa