Merge branch 'tr/log-full-diff-keep-true-parents'
[gitweb.git] / transport.c
index e15db9808c85a3918a8de3c409500aaa78d1328e..b321d6a49d40c78612284557f7ef6d7822a45c8f 100644 (file)
@@ -3,6 +3,8 @@
 #include "run-command.h"
 #include "pkt-line.h"
 #include "fetch-pack.h"
+#include "remote.h"
+#include "connect.h"
 #include "send-pack.h"
 #include "walker.h"
 #include "bundle.h"
@@ -707,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,
@@ -1076,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);
@@ -1140,6 +1147,12 @@ int transport_push(struct transport *transport,
                        return -1;
                }
 
+               if (transport->smart_options &&
+                   transport->smart_options->cas &&
+                   !is_empty_cas(transport->smart_options->cas))
+                       apply_push_cas(transport->smart_options->cas,
+                                      transport->remote, remote_refs);
+
                set_ref_status_for_push(remote_refs,
                        flags & TRANSPORT_PUSH_MIRROR,
                        flags & TRANSPORT_PUSH_FORCE);