THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Git Source Code Mirror - This is a publish-only repository and all pull requests are ignored. Please follow Documentation/SubmittingPatches procedure for any of your improvements.
git
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
2.9KB

  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. unsigned from_promisor:1;
  39. /*
  40. * Attempt to fetch only the wanted objects, and not any objects
  41. * referred to by them. Due to protocol limitations, extraneous
  42. * objects may still be included. (When fetching non-blob
  43. * objects, only blobs are excluded; when fetching a blob, the
  44. * blob itself will still be sent. The client does not need to
  45. * know whether a wanted object is a blob or not.)
  46. *
  47. * If 1, fetch_pack() will also not modify any object flags.
  48. * This allows fetch_pack() to safely be called by any function,
  49. * regardless of which object flags it uses (if any).
  50. */
  51. unsigned no_dependents:1;
  52. /*
  53. * Because fetch_pack() overwrites the shallow file upon a
  54. * successful deepening non-clone fetch, if this struct
  55. * specifies such a fetch, fetch_pack() needs to perform a
  56. * connectivity check before deciding if a fetch is successful
  57. * (and overwriting the shallow file). fetch_pack() sets this
  58. * field to 1 if such a connectivity check was performed.
  59. *
  60. * This is different from check_self_contained_and_connected
  61. * in that the former allows existing objects in the
  62. * repository to satisfy connectivity needs, whereas the
  63. * latter doesn't.
  64. */
  65. unsigned connectivity_checked:1;
  66. };
  67. /*
  68. * sought represents remote references that should be updated from.
  69. * On return, the names that were found on the remote will have been
  70. * marked as such.
  71. */
  72. struct ref *fetch_pack(struct fetch_pack_args *args,
  73. int fd[],
  74. const struct ref *ref,
  75. struct ref **sought,
  76. int nr_sought,
  77. struct oid_array *shallow,
  78. char **pack_lockfile,
  79. enum protocol_version version);
  80. /*
  81. * Print an appropriate error message for each sought ref that wasn't
  82. * matched. Return 0 if all sought refs were matched, otherwise 1.
  83. */
  84. int report_unmatched_refs(struct ref **sought, int nr_sought);
  85. #endif