diff options
author | Edward Thomson <ethomson@microsoft.com> | 2014-08-23 18:19:34 -0500 |
---|---|---|
committer | Edward Thomson <ethomson@microsoft.com> | 2014-10-26 22:59:34 -0400 |
commit | 18b439b9beee050de0dbf2f4649609764a69fb3c (patch) | |
tree | 043352fecce9b94e3b96c8445a4b028c7b9cea8e /src/rebase.c | |
parent | 5ae9d296e3313be59a969cb8eab250c7c8f7307d (diff) | |
download | libgit2-18b439b9beee050de0dbf2f4649609764a69fb3c.tar.gz |
git_rebase_next: provide info about the operation
Diffstat (limited to 'src/rebase.c')
-rw-r--r-- | src/rebase.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/rebase.c b/src/rebase.c index 3384a14f2..c6bbfbfb8 100644 --- a/src/rebase.c +++ b/src/rebase.c @@ -624,6 +624,7 @@ static int normalize_checkout_opts( } static int rebase_next_merge( + git_rebase_operation *out, git_repository *repo, git_rebase_state *state, git_checkout_options *given_checkout_opts) @@ -678,6 +679,9 @@ static int rebase_next_merge( (error = git_checkout_index(repo, index, &checkout_opts)) < 0) goto done; + out->type = GIT_REBASE_OPERATION_PICK; + memcpy(&out->id, ¤t_id, sizeof(git_oid)); + done: git_index_free(index); git_tree_free(current_tree); @@ -691,20 +695,23 @@ done: } int git_rebase_next( + git_rebase_operation *out, git_repository *repo, git_checkout_options *checkout_opts) { git_rebase_state state = GIT_REBASE_STATE_INIT; int error; - assert(repo); + assert(out && repo); + + memset(out, 0, sizeof(git_rebase_operation)); if ((error = rebase_state(&state, repo)) < 0) return -1; switch (state.type) { case GIT_REBASE_TYPE_MERGE: - error = rebase_next_merge(repo, &state, checkout_opts); + error = rebase_next_merge(out, repo, &state, checkout_opts); break; default: abort(); |