@ -303,7 +303,12 @@ static int check_to_send_update(const struct ref *ref, const struct send_pack_ar
return CHECK_REF_STATUS_REJECTED;
return CHECK_REF_STATUS_REJECTED;
case REF_STATUS_UPTODATE:
case REF_STATUS_UPTODATE:
return CHECK_REF_UPTODATE;
return CHECK_REF_UPTODATE;
default:
default:
case REF_STATUS_EXPECTING_REPORT:
/* already passed checks on the local side */
case REF_STATUS_OK:
/* of course this is OK */
return 0;
return 0;
}
}
}
}
@ -510,13 +515,6 @@ int send_pack(struct send_pack_args *args,
if (ref->deletion && !allow_deleting_refs)
if (ref->deletion && !allow_deleting_refs)
ref->status = REF_STATUS_REJECT_NODELETE;
ref->status = REF_STATUS_REJECT_NODELETE;
if (!args->dry_run)
advertise_shallow_grafts_buf(&req_buf);
if (!args->dry_run && push_cert_nonce)
cmds_sent = generate_push_cert(&req_buf, remote_refs, args,
cap_buf.buf, push_cert_nonce);
/*
/*
* Clear the status for each ref and see if we need to send
* Clear the status for each ref and see if we need to send
* the pack data.
* the pack data.
@ -552,15 +550,19 @@ int send_pack(struct send_pack_args *args,
ref->status = REF_STATUS_EXPECTING_REPORT;
ref->status = REF_STATUS_EXPECTING_REPORT;
}
}
if (!args->dry_run)
advertise_shallow_grafts_buf(&req_buf);
/*
/*
* Finally, tell the other end!
* Finally, tell the other end!
*/
*/
if (!args->dry_run && push_cert_nonce)
cmds_sent = generate_push_cert(&req_buf, remote_refs, args,
cap_buf.buf, push_cert_nonce);
else if (!args->dry_run)
for (ref = remote_refs; ref; ref = ref->next) {
for (ref = remote_refs; ref; ref = ref->next) {
char *old_hex, *new_hex;
char *old_hex, *new_hex;
if (args->dry_run || push_cert_nonce)
continue;
if (check_to_send_update(ref, args) < 0)
if (check_to_send_update(ref, args) < 0)
continue;
continue;