diff options
| author | Edward Thomson <ethomson@microsoft.com> | 2013-09-23 09:47:47 -0400 |
|---|---|---|
| committer | Edward Thomson <ethomson@microsoft.com> | 2013-10-16 16:20:19 -0400 |
| commit | 216f97e4f68c99c21d57a9196702df1f8f4366d4 (patch) | |
| tree | d0bbcdc72f8ae85b79e8bfb43d1893184aaaabda /src/checkout.h | |
| parent | cfae7f85fbbc5b0e023e94f78486bf72cc1436f5 (diff) | |
| download | libgit2-216f97e4f68c99c21d57a9196702df1f8f4366d4.tar.gz | |
Two-step conflict checkout (load / perform)
Move conflict handling into two steps: load the conflicts and
then apply the conflicts. This is more compatible with the
existing checkout implementation and makes progress reporting
more sane.
Diffstat (limited to 'src/checkout.h')
| -rw-r--r-- | src/checkout.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/checkout.h b/src/checkout.h index 9a8098998..d48e263e4 100644 --- a/src/checkout.h +++ b/src/checkout.h @@ -22,6 +22,7 @@ typedef struct { git_index *index; git_pool pool; git_vector removes; + git_vector conflicts; git_buf path; size_t workdir_len; unsigned int strategy; @@ -31,6 +32,29 @@ typedef struct { size_t completed_steps; } checkout_data; +typedef struct { + const git_index_entry *ancestor; + const git_index_entry *ours; + const git_index_entry *theirs; + + int name_collision:1, + directoryfile:1, + one_to_two:1; +} checkout_conflictdata; + +enum { + CHECKOUT_ACTION__NONE = 0, + CHECKOUT_ACTION__REMOVE = 1, + CHECKOUT_ACTION__UPDATE_BLOB = 2, + CHECKOUT_ACTION__UPDATE_SUBMODULE = 4, + CHECKOUT_ACTION__CONFLICT = 8, + CHECKOUT_ACTION__UPDATE_CONFLICT = 16, + CHECKOUT_ACTION__MAX = 16, + CHECKOUT_ACTION__DEFER_REMOVE = 32, + CHECKOUT_ACTION__REMOVE_AND_UPDATE = + (CHECKOUT_ACTION__UPDATE_BLOB | CHECKOUT_ACTION__REMOVE), +}; + /** * Update the working directory to match the target iterator. The * expected baseline value can be passed in via the checkout options @@ -52,6 +76,11 @@ int git_checkout__write_content( unsigned int mode, struct stat *st); +void git_checkout__report_progress( + checkout_data *data, + const char *path); + +int git_checkout__get_conflicts(checkout_data *data, git_iterator *workdir, git_vector *pathspec); int git_checkout__conflicts(checkout_data *data); #endif |
