diff options
| author | Edward Thomson <ethomson@github.com> | 2016-02-11 10:48:48 -0800 |
|---|---|---|
| committer | Edward Thomson <ethomson@github.com> | 2016-02-11 10:48:48 -0800 |
| commit | ee6673070a6134f0a1743c866583b14a305b6a43 (patch) | |
| tree | 44e7b14e9ed28baa15c763332ec8909052970e47 /include/git2/rebase.h | |
| parent | 488e2b85053a45dd2ce6a37b7d5cf70870be5ed8 (diff) | |
| download | libgit2-ee6673070a6134f0a1743c866583b14a305b6a43.tar.gz | |
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.
Diffstat (limited to 'include/git2/rebase.h')
| -rw-r--r-- | include/git2/rebase.h | 17 |
1 files changed, 16 insertions, 1 deletions
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 @@ -39,6 +39,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; * if NULL, the contents of the configuration option `notes.rewriteRef` @@ -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; /** |
