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.

74 lines
2.0KB

  1. #ifndef CONNECTED_H
  2. #define CONNECTED_H
  3. struct object_id;
  4. struct transport;
  5. /*
  6. * Take callback data, and return next object name in the buffer.
  7. * When called after returning the name for the last object, return -1
  8. * to signal EOF, otherwise return 0.
  9. */
  10. typedef int (*oid_iterate_fn)(void *, struct object_id *oid);
  11. /*
  12. * Named-arguments struct for check_connected. All arguments are
  13. * optional, and can be left to defaults as set by CHECK_CONNECTED_INIT.
  14. */
  15. struct check_connected_options {
  16. /* Avoid printing any errors to stderr. */
  17. int quiet;
  18. /* --shallow-file to pass to rev-list sub-process */
  19. const char *shallow_file;
  20. /* Transport whose objects we are checking, if available. */
  21. struct transport *transport;
  22. /*
  23. * If non-zero, send error messages to this descriptor rather
  24. * than stderr. The descriptor is closed before check_connected
  25. * returns.
  26. */
  27. int err_fd;
  28. /* If non-zero, show progress as we traverse the objects. */
  29. int progress;
  30. /*
  31. * Insert these variables into the environment of the child process.
  32. */
  33. const char **env;
  34. /*
  35. * If non-zero, check the ancestry chain completely, not stopping at
  36. * any existing ref. This is necessary when deepening existing refs
  37. * during a fetch.
  38. */
  39. unsigned is_deepening_fetch : 1;
  40. /*
  41. * If non-zero, only check the top-level objects referenced by the
  42. * wanted refs (passed in as cb_data). This is useful for partial
  43. * clones, where enumerating and excluding all promisor objects is very
  44. * slow and the commit-walk itself becomes a no-op.
  45. */
  46. unsigned check_refs_only : 1;
  47. };
  48. #define CHECK_CONNECTED_INIT { 0 }
  49. /*
  50. * Make sure that all given objects and all objects reachable from them
  51. * either exist in our object store or (if the repository is a partial
  52. * clone) are promised to be available.
  53. *
  54. * Return 0 if Ok, non zero otherwise (i.e. some missing objects)
  55. *
  56. * If "opt" is NULL, behaves as if CHECK_CONNECTED_INIT was passed.
  57. */
  58. int check_connected(oid_iterate_fn fn, void *cb_data,
  59. struct check_connected_options *opt);
  60. #endif /* CONNECTED_H */