From ee6673070a6134f0a1743c866583b14a305b6a43 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Thu, 11 Feb 2016 10:48:48 -0800 Subject: rebase: introduce inmemory rebasing Introduce the ability to rebase in-memory or in a bare repository. When `rebase_options.inmemory` is specified, the resultant `git_rebase` session will not be persisted to disk. Callers may still analyze the rebase operations, resolve any conflicts against the in-memory index and create the commits. Neither `HEAD` nor the working directory will be updated during this process. --- include/git2/rebase.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'include/git2/rebase.h') diff --git a/include/git2/rebase.h b/include/git2/rebase.h index cf1b00fd9..17c4557e8 100644 --- a/include/git2/rebase.h +++ b/include/git2/rebase.h @@ -38,6 +38,15 @@ typedef struct { */ int quiet; + /** + * Used by `git_rebase_init`, this will begin an in-memory rebase, + * which will allow callers to step through the rebase operations and + * commit the rebased changes, but will not rewind HEAD or update the + * repository to be in a rebasing state. This will not interfere with + * the working directory (if there is one). + */ + int inmemory; + /** * Used by `git_rebase_finish`, this is the name of the notes reference * used to rewrite notes for rebased commits when finishing the rebase; @@ -101,7 +110,7 @@ typedef enum { #define GIT_REBASE_OPTIONS_VERSION 1 #define GIT_REBASE_OPTIONS_INIT \ - {GIT_REBASE_OPTIONS_VERSION, 0, NULL, GIT_CHECKOUT_OPTIONS_INIT} + {GIT_REBASE_OPTIONS_VERSION, 0, 0, NULL, GIT_CHECKOUT_OPTIONS_INIT} /** Indicates that a rebase operation is not (yet) in progress. */ #define GIT_REBASE_NO_OPERATION SIZE_MAX @@ -127,6 +136,12 @@ 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; /** -- cgit v1.2.1