diff options
author | Edward Thomson <ethomson@github.com> | 2016-02-15 17:16:00 +0000 |
---|---|---|
committer | Edward Thomson <ethomson@github.com> | 2016-02-15 19:27:06 +0000 |
commit | f28bae0c380467409515ffd25247f3204dcc4019 (patch) | |
tree | 437cafaa9d8afc0b59c6b63bd5d5cf068fc52fe7 /include/git2/rebase.h | |
parent | 5a296ad07ea5536a0ac2f17921f2839612d838d3 (diff) | |
download | libgit2-f28bae0c380467409515ffd25247f3204dcc4019.tar.gz |
rebase: persist a single in-memory index
When performing an in-memory rebase, keep a single index for the
duration, so that callers have the expected index lifecycle and
do not hold on to an index that is free'd out from under them.
Diffstat (limited to 'include/git2/rebase.h')
-rw-r--r-- | include/git2/rebase.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/include/git2/rebase.h b/include/git2/rebase.h index 4fda1fd2f..ece8b3664 100644 --- a/include/git2/rebase.h +++ b/include/git2/rebase.h @@ -142,12 +142,6 @@ typedef struct { * be populated for operations of type `GIT_REBASE_OPERATION_EXEC`. */ const char *exec; - - /** - * The index that is the result of an operation. - * This is set only for in-memory rebases. - */ - git_index *index; } git_rebase_operation; /** @@ -248,6 +242,21 @@ GIT_EXTERN(int) git_rebase_next( git_rebase *rebase); /** + * Gets the index produced by the last operation, which is the result + * of `git_rebase_next` and which will be committed by the next + * invocation of `git_rebase_commit`. This is useful for resolving + * conflicts in an in-memory rebase before committing them. You must + * call `git_index_free` when you are finished with this. + * + * This is only applicable for in-memory rebases; for rebases within + * a working directory, the changes were applied to the repository's + * index. + */ +GIT_EXTERN(int) git_rebase_inmemory_index( + git_index **index, + git_rebase *rebase); + +/** * Commits the current patch. You must have resolved any conflicts that * were introduced during the patch application from the `git_rebase_next` * invocation. |