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.
 
 
 
 
 
 

90 lines
2.2 KiB

  1. #ifndef UNPACK_TREES_H
  2. #define UNPACK_TREES_H
  3. #include "string-list.h"
  4. #define MAX_UNPACK_TREES 8
  5. struct unpack_trees_options;
  6. struct exclude_list;
  7. typedef int (*merge_fn_t)(const struct cache_entry * const *src,
  8. struct unpack_trees_options *options);
  9. enum unpack_trees_error_types {
  10. ERROR_WOULD_OVERWRITE = 0,
  11. ERROR_NOT_UPTODATE_FILE,
  12. ERROR_NOT_UPTODATE_DIR,
  13. ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN,
  14. ERROR_WOULD_LOSE_UNTRACKED_REMOVED,
  15. ERROR_BIND_OVERLAP,
  16. ERROR_SPARSE_NOT_UPTODATE_FILE,
  17. ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN,
  18. ERROR_WOULD_LOSE_ORPHANED_REMOVED,
  19. NB_UNPACK_TREES_ERROR_TYPES
  20. };
  21. /*
  22. * Sets the list of user-friendly error messages to be used by the
  23. * command "cmd" (either merge or checkout), and show_all_errors to 1.
  24. */
  25. void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
  26. const char *cmd);
  27. struct unpack_trees_options {
  28. unsigned int reset,
  29. merge,
  30. update,
  31. index_only,
  32. nontrivial_merge,
  33. trivial_merges_only,
  34. verbose_update,
  35. aggressive,
  36. skip_unmerged,
  37. initial_checkout,
  38. diff_index_cached,
  39. debug_unpack,
  40. skip_sparse_checkout,
  41. gently,
  42. exiting_early,
  43. show_all_errors,
  44. dry_run;
  45. const char *prefix;
  46. int cache_bottom;
  47. struct dir_struct *dir;
  48. struct pathspec *pathspec;
  49. merge_fn_t fn;
  50. const char *msgs[NB_UNPACK_TREES_ERROR_TYPES];
  51. /*
  52. * Store error messages in an array, each case
  53. * corresponding to a error message type
  54. */
  55. struct string_list unpack_rejects[NB_UNPACK_TREES_ERROR_TYPES];
  56. int head_idx;
  57. int merge_size;
  58. struct cache_entry *df_conflict_entry;
  59. void *unpack_data;
  60. struct index_state *dst_index;
  61. struct index_state *src_index;
  62. struct index_state result;
  63. struct exclude_list *el; /* for internal use */
  64. };
  65. extern int unpack_trees(unsigned n, struct tree_desc *t,
  66. struct unpack_trees_options *options);
  67. int threeway_merge(const struct cache_entry * const *stages,
  68. struct unpack_trees_options *o);
  69. int twoway_merge(const struct cache_entry * const *src,
  70. struct unpack_trees_options *o);
  71. int bind_merge(const struct cache_entry * const *src,
  72. struct unpack_trees_options *o);
  73. int oneway_merge(const struct cache_entry * const *src,
  74. struct unpack_trees_options *o);
  75. #endif