diff options
author | Tay Ray Chuan <rctay89@gmail.com> | 2010-01-08 10:12:44 +0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-09 23:34:10 -0800 |
commit | 08d63a422ba7293119865e6cbbc3a34619be32f7 (patch) | |
tree | b15ad3ede23cae68776af087d4990d5f041d87ed /transport-helper.c | |
parent | 4232826771d5bdc4cc0bd21188b6ee5f3e700a52 (diff) | |
download | git-08d63a422ba7293119865e6cbbc3a34619be32f7.tar.gz |
transport-helper.c::push_refs(): ignore helper-reported status if ref is not to be pushed
If the status of a ref is REF_STATUS_NONE, the remote helper will not
be told to push the ref (via a 'push' command).
However, the remote helper may still act on these refs.
If the helper does act on the ref, and prints a status for it, ignore
the report (ie. don't overwrite the status of the ref with it, nor the
message in the remote_status member) if the reported status is 'no
match'.
This allows the user to be alerted to more "interesting" ref statuses,
like REF_STATUS_NONFASTFORWARD.
Cc: Jeff King <peff@peff.net>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport-helper.c')
-rw-r--r-- | transport-helper.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/transport-helper.c b/transport-helper.c index 7c9b569d94..71a1e50ee7 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -430,6 +430,15 @@ static int push_refs(struct transport *transport, continue; } + if (ref->status != REF_STATUS_NONE) { + /* + * Earlier, the ref was marked not to be pushed, so ignore the ref + * status reported by the remote helper if the latter is 'no match'. + */ + if (status == REF_STATUS_NONE) + continue; + } + ref->status = status; ref->remote_status = msg; } |