Skip to content

Commit

Permalink
transport-helper: check for 'forced update' message
Browse files Browse the repository at this point in the history
So the remote-helpers can tell us when a forced push was needed.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Felipe Contreras authored and Junio C Hamano committed Nov 12, 2013
1 parent 510fa6f commit f9e3c6b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion transport-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,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;
Expand Down Expand Up @@ -701,6 +701,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)
Expand All @@ -722,6 +727,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);
}
Expand Down

0 comments on commit f9e3c6b

Please sign in to comment.