450
451
flushes = 0;
452
retval = -1;
453
+ if (args->no_dependents)
454
+ goto done;
455
while ((oid = get_rev())) {
456
packet_buf_write(&req_buf, "have %s\n", oid_to_hex(oid));
457
print_verbose(args, "have %s", oid_to_hex(oid));
736
}
737
}
738
737
- if (!args->deepen) {
738
- for_each_ref(mark_complete_oid, NULL);
739
- for_each_cached_alternate(mark_alternate_complete);
740
- commit_list_sort_by_date(&complete);
741
- if (cutoff)
742
- mark_recent_complete_commits(args, cutoff);
743
- }
739
+ if (!args->no_dependents) {
740
+ if (!args->deepen) {
741
+ for_each_ref(mark_complete_oid, NULL);
742
+ for_each_cached_alternate(mark_alternate_complete);
743
+ commit_list_sort_by_date(&complete);
744
+ if (cutoff)
745
+ mark_recent_complete_commits(args, cutoff);
746
+ }
747
745
- /*
746
- * Mark all complete remote refs as common refs.
747
- * Don't mark them common yet; the server has to be told so first.
748
- */
749
- for (ref = *refs; ref; ref = ref->next) {
750
- struct object *o = deref_tag(lookup_object(ref->old_oid.hash),
751
- NULL, 0);
748
+ /*
749
+ * Mark all complete remote refs as common refs.
750
+ * Don't mark them common yet; the server has to be told so first.
751
+ */
752
+ for (ref = *refs; ref; ref = ref->next) {
753
+ struct object *o = deref_tag(lookup_object(ref->old_oid.hash),
754
+ NULL, 0);
755
753
- if (!o || o->type != OBJ_COMMIT || !(o->flags & COMPLETE))
754
- continue;
756
+ if (!o || o->type != OBJ_COMMIT || !(o->flags & COMPLETE))
757
+ continue;
758
756
- if (!(o->flags & SEEN)) {
757
- rev_list_push((struct commit *)o, COMMON_REF | SEEN);
759
+ if (!(o->flags & SEEN)) {
760
+ rev_list_push((struct commit *)o, COMMON_REF | SEEN);
761
759
- mark_common((struct commit *)o, 1, 1);
762
+ mark_common((struct commit *)o, 1, 1);
763
+ }
764
}
765
}
766
836
argv_array_push(&cmd.args, alternate_shallow_file);
837
}
838
835
- if (do_keep) {
839
+ if (do_keep || args->from_promisor) {
840
if (pack_lockfile)
841
cmd.out = -1;
842
cmd_name = "index-pack";
846
argv_array_push(&cmd.args, "-v");
847
if (args->use_thin_pack)
848
argv_array_push(&cmd.args, "--fix-thin");
845
- if (args->lock_pack || unpack_limit) {
849
+ if (do_keep && (args->lock_pack || unpack_limit)) {
850
char hostname[HOST_NAME_MAX + 1];
851
if (xgethostname(hostname, sizeof(hostname)))
852
xsnprintf(hostname, sizeof(hostname), "localhost");
856
}
857
if (args->check_self_contained_and_connected)
858
argv_array_push(&cmd.args, "--check-self-contained-and-connected");
859
+ if (args->from_promisor)
860
+ argv_array_push(&cmd.args, "--promisor");
861
}
862
else {
863
cmd_name = "unpack-objects";