summaryrefslogtreecommitdiff
path: root/src/index.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.h')
-rw-r--r--src/index.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/index.h b/src/index.h
index d151f6614..6d2904fdc 100644
--- a/src/index.h
+++ b/src/index.h
@@ -97,6 +97,7 @@ extern int git_index_snapshot_find(
typedef struct {
git_index *index;
git_filebuf file;
+ unsigned int should_write:1;
} git_indexwriter;
#define GIT_INDEXWRITER_INIT { NULL, GIT_FILEBUF_INIT }
@@ -104,6 +105,16 @@ typedef struct {
/* Lock the index for eventual writing. */
extern int git_indexwriter_init(git_indexwriter *writer, git_index *index);
+/* Lock the index for eventual writing by a repository operation: a merge,
+ * revert, cherry-pick or a rebase. Note that the given checkout strategy
+ * will be updated for the operation's use so that checkout will not write
+ * the index.
+ */
+extern int git_indexwriter_init_for_operation(
+ git_indexwriter *writer,
+ git_repository *repo,
+ unsigned int *checkout_strategy);
+
/* Write the index and unlock it. */
extern int git_indexwriter_commit(git_indexwriter *writer);