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.

56 lines
1.3KB

  1. #ifndef REFSPEC_H
  2. #define REFSPEC_H
  3. #define TAG_REFSPEC "refs/tags/*:refs/tags/*"
  4. extern const struct refspec_item *tag_refspec;
  5. struct refspec_item {
  6. unsigned force : 1;
  7. unsigned pattern : 1;
  8. unsigned matching : 1;
  9. unsigned exact_sha1 : 1;
  10. char *src;
  11. char *dst;
  12. };
  13. #define REFSPEC_FETCH 1
  14. #define REFSPEC_PUSH 0
  15. #define REFSPEC_INIT_FETCH { .fetch = REFSPEC_FETCH }
  16. #define REFSPEC_INIT_PUSH { .fetch = REFSPEC_PUSH }
  17. struct refspec {
  18. struct refspec_item *items;
  19. int alloc;
  20. int nr;
  21. const char **raw;
  22. int raw_alloc;
  23. int raw_nr;
  24. int fetch;
  25. };
  26. int refspec_item_init(struct refspec_item *item, const char *refspec,
  27. int fetch);
  28. void refspec_item_init_or_die(struct refspec_item *item, const char *refspec,
  29. int fetch);
  30. void refspec_item_clear(struct refspec_item *item);
  31. void refspec_init(struct refspec *rs, int fetch);
  32. void refspec_append(struct refspec *rs, const char *refspec);
  33. void refspec_appendn(struct refspec *rs, const char **refspecs, int nr);
  34. void refspec_clear(struct refspec *rs);
  35. int valid_fetch_refspec(const char *refspec);
  36. struct argv_array;
  37. /*
  38. * Determine what <prefix> values to pass to the peer in ref-prefix lines
  39. * (see Documentation/technical/protocol-v2.txt).
  40. */
  41. void refspec_ref_prefixes(const struct refspec *rs,
  42. struct argv_array *ref_prefixes);
  43. #endif /* REFSPEC_H */