git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: git@vger.kernel.org
Cc: Sverre Rabbelier <srabbelier@gmail.com>,
	Richard Hansen <rhansen@bbn.com>,
	Felipe Contreras <felipe.contreras@gmail.com>
Subject: [PATCH v3 03/10] transport-helper: check for 'forced update' message
Date: Sat, 12 Oct 2013 02:05:24 -0500	[thread overview]
Message-ID: <1381561533-20381-2-git-send-email-felipe.contreras@gmail.com> (raw)
In-Reply-To: <1381561533-20381-1-git-send-email-felipe.contreras@gmail.com>

So the remote-helpers can tell us when a forced push was needed.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 transport-helper.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/transport-helper.c b/transport-helper.c
index ed3384e..46b3e57 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -630,7 +630,7 @@ static int push_update_ref_status(struct strbuf *buf,
 				   struct ref *remote_refs)
 {
 	char *refname, *msg;
-	int status;
+	int status, forced = 0;
 
 	if (!prefixcmp(buf->buf, "ok ")) {
 		status = REF_STATUS_OK;
@@ -683,6 +683,11 @@ static int push_update_ref_status(struct strbuf *buf,
 			free(msg);
 			msg = NULL;
 		}
+		else if (!strcmp(msg, "forced update")) {
+			forced = 1;
+			free(msg);
+			msg = NULL;
+		}
 	}
 
 	if (*ref)
@@ -704,6 +709,7 @@ static int push_update_ref_status(struct strbuf *buf,
 	}
 
 	(*ref)->status = status;
+	(*ref)->forced_update = forced;
 	(*ref)->remote_status = msg;
 	return !(status == REF_STATUS_OK);
 }
-- 
1.8.4-fc

  reply	other threads:[~2013-10-12  7:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-12  7:05 [PATCH v3 00/10] transport-helper: updates Felipe Contreras
2013-10-12  7:05 ` Felipe Contreras [this message]
2013-10-12  7:05 ` [PATCH v3 05/10] fast-export: add new --refspec option Felipe Contreras
2013-10-14 19:42   ` Eric Sunshine
2013-10-12  7:05 ` [PATCH v3 06/10] transport-helper: add support for old:new refspec Felipe Contreras
2013-10-12  7:05 ` [PATCH v3 02/10] transport-helper: fix extra lines Felipe Contreras
2013-10-12  7:05 ` [PATCH v3 09/10] transport-helper: add support to delete branches Felipe Contreras
2013-10-27  4:34   ` [PATCH v3 11/10] fixup! " Richard Hansen
2013-10-27  4:55     ` Felipe Contreras
2013-10-27  5:00       ` Felipe Contreras
2013-10-12  7:05 ` [PATCH v3 01/10] transport-helper: add 'force' to 'export' helpers Felipe Contreras
2013-10-12  7:05 ` [PATCH v3 08/10] fast-export: add support to delete refs Felipe Contreras
2013-10-12  7:05 ` [PATCH v3 10/10] transport-helper: don't update refs in dry-run Felipe Contreras
2013-10-12  7:05 ` [PATCH v3 07/10] fast-import: add support to delete refs Felipe Contreras
2013-10-12  7:05 ` [PATCH v3 04/10] fast-export: improve argument parsing Felipe Contreras
2013-10-27  6:23 ` [PATCH v3 00/10] transport-helper: updates Richard Hansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1381561533-20381-2-git-send-email-felipe.contreras@gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=rhansen@bbn.com \
    --cc=srabbelier@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).