244
return CHECK_REF_STATUS_REJECTED;
245
case REF_STATUS_UPTODATE:
246
return CHECK_REF_UPTODATE;
247
+
248
default:
249
+ case REF_STATUS_EXPECTING_REPORT:
250
+ /* already passed checks on the local side */
251
+ case REF_STATUS_OK:
252
+ /* of course this is OK */
253
return 0;
254
}
255
}
452
if (ref->deletion && !allow_deleting_refs)
453
ref->status = REF_STATUS_REJECT_NODELETE;
454
450
- if (!args->dry_run)
451
- advertise_shallow_grafts_buf(&req_buf);
452
-
453
- if (!args->dry_run && push_cert_nonce)
454
- cmds_sent = generate_push_cert(&req_buf, remote_refs, args,
455
- cap_buf.buf, push_cert_nonce);
456
-
455
/*
456
* Clear the status for each ref and see if we need to send
457
* the pack data.
487
ref->status = REF_STATUS_EXPECTING_REPORT;
488
}
489
490
+ if (!args->dry_run)
491
+ advertise_shallow_grafts_buf(&req_buf);
492
+
493
/*
494
* Finally, tell the other end!
495
*/
495
- for (ref = remote_refs; ref; ref = ref->next) {
496
- char *old_hex, *new_hex;
497
-
498
- if (args->dry_run || push_cert_nonce)
499
- continue;
500
-
501
- if (check_to_send_update(ref, args) < 0)
502
- continue;
503
-
504
- old_hex = oid_to_hex(&ref->old_oid);
505
- new_hex = oid_to_hex(&ref->new_oid);
506
- if (!cmds_sent) {
507
- packet_buf_write(&req_buf,
508
- "%s %s %s%c%s",
509
- old_hex, new_hex, ref->name, 0,
510
- cap_buf.buf);
511
- cmds_sent = 1;
512
- } else {
513
- packet_buf_write(&req_buf, "%s %s %s",
514
- old_hex, new_hex, ref->name);
496
+ if (!args->dry_run && push_cert_nonce)
497
+ cmds_sent = generate_push_cert(&req_buf, remote_refs, args,
498
+ cap_buf.buf, push_cert_nonce);
499
+ else if (!args->dry_run)
500
+ for (ref = remote_refs; ref; ref = ref->next) {
501
+ char *old_hex, *new_hex;
502
+
503
+ if (check_to_send_update(ref, args) < 0)
504
+ continue;
505
+
506
+ old_hex = oid_to_hex(&ref->old_oid);
507
+ new_hex = oid_to_hex(&ref->new_oid);
508
+ if (!cmds_sent) {
509
+ packet_buf_write(&req_buf,
510
+ "%s %s %s%c%s",
511
+ old_hex, new_hex, ref->name, 0,
512
+ cap_buf.buf);
513
+ cmds_sent = 1;
514
+ } else {
515
+ packet_buf_write(&req_buf, "%s %s %s",
516
+ old_hex, new_hex, ref->name);
517
+ }
518
}
516
- }
519
520
if (use_push_options) {
521
struct string_list_item *item;