From 631b5ef219c41027c144218e25075062b91f9471 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 8 Jul 2013 14:42:40 -0700 Subject: push --force-with-lease: tie it all together This teaches the deepest part of the callchain for "git push" (and "git send-pack") to enforce "the old value of the ref must be this, otherwise fail this push" (aka "compare-and-swap" / "--lockref"). Signed-off-by: Junio C Hamano --- transport.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'transport.c') diff --git a/transport.c b/transport.c index 5dd92b7801..b321d6a49d 100644 --- a/transport.c +++ b/transport.c @@ -709,6 +709,10 @@ static int print_one_push_status(struct ref *ref, const char *dest, int count, i print_ref_status('!', "[rejected]", ref, ref->peer_ref, "needs force", porcelain); break; + case REF_STATUS_REJECT_STALE: + print_ref_status('!', "[rejected]", ref, ref->peer_ref, + "stale info", porcelain); + break; case REF_STATUS_REMOTE_REJECT: print_ref_status('!', "[remote rejected]", ref, ref->deletion ? NULL : ref->peer_ref, @@ -1078,6 +1082,7 @@ static int run_pre_push_hook(struct transport *transport, for (r = remote_refs; r; r = r->next) { if (!r->peer_ref) continue; if (r->status == REF_STATUS_REJECT_NONFASTFORWARD) continue; + if (r->status == REF_STATUS_REJECT_STALE) continue; if (r->status == REF_STATUS_UPTODATE) continue; strbuf_reset(&buf); -- cgit v1.2.3