fetch-pack.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef FETCH_PACK_H
  2. #define FETCH_PACK_H
  3. #include "string-list.h"
  4. #include "run-command.h"
  5. #include "protocol.h"
  6. #include "list-objects-filter-options.h"
  7. struct oid_array;
  8. struct fetch_pack_args {
  9. const char *uploadpack;
  10. int unpacklimit;
  11. int depth;
  12. const char *deepen_since;
  13. const struct string_list *deepen_not;
  14. struct list_objects_filter_options filter_options;
  15. const struct string_list *server_options;
  16. /*
  17. * If not NULL, during packfile negotiation, fetch-pack will send "have"
  18. * lines only with these tips and their ancestors.
  19. */
  20. const struct oid_array *negotiation_tips;
  21. unsigned deepen_relative:1;
  22. unsigned quiet:1;
  23. unsigned keep_pack:1;
  24. unsigned lock_pack:1;
  25. unsigned use_thin_pack:1;
  26. unsigned fetch_all:1;
  27. unsigned stdin_refs:1;
  28. unsigned diag_url:1;
  29. unsigned verbose:1;
  30. unsigned no_progress:1;
  31. unsigned include_tag:1;
  32. unsigned stateless_rpc:1;
  33. unsigned check_self_contained_and_connected:1;
  34. unsigned self_contained_and_connected:1;
  35. unsigned cloning:1;
  36. unsigned update_shallow:1;
  37. unsigned deepen:1;
  38. /*
  39. * Indicate that the remote of this request is a promisor remote. The
  40. * pack received does not need all referred-to objects to be present in
  41. * the local object store, and fetch-pack will store the pack received
  42. * together with a ".promisor" file indicating that the aforementioned
  43. * pack is a promisor pack.
  44. */
  45. unsigned from_promisor:1;
  46. /*
  47. * Because fetch_pack() overwrites the shallow file upon a
  48. * successful deepening non-clone fetch, if this struct
  49. * specifies such a fetch, fetch_pack() needs to perform a
  50. * connectivity check before deciding if a fetch is successful
  51. * (and overwriting the shallow file). fetch_pack() sets this
  52. * field to 1 if such a connectivity check was performed.
  53. *
  54. * This is different from check_self_contained_and_connected
  55. * in that the former allows existing objects in the
  56. * repository to satisfy connectivity needs, whereas the
  57. * latter doesn't.
  58. */
  59. unsigned connectivity_checked:1;
  60. };
  61. /*
  62. * sought represents remote references that should be updated from.
  63. * On return, the names that were found on the remote will have been
  64. * marked as such.
  65. */
  66. struct ref *fetch_pack(struct fetch_pack_args *args,
  67. int fd[],
  68. const struct ref *ref,
  69. struct ref **sought,
  70. int nr_sought,
  71. struct oid_array *shallow,
  72. struct string_list *pack_lockfiles,
  73. enum protocol_version version);
  74. /*
  75. * Print an appropriate error message for each sought ref that wasn't
  76. * matched. Return 0 if all sought refs were matched, otherwise 1.
  77. */
  78. int report_unmatched_refs(struct ref **sought, int nr_sought);
  79. #endif