summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2015-03-17 10:04:08 -0400
committerEdward Thomson <ethomson@microsoft.com>2015-04-20 16:22:27 -0400
commit30640aa9ad574761a3a69244c6194eb626e69d40 (patch)
tree02201b32fe3b2e3f8dbceaa83b018c0cb0ed48a2 /include
parent08c45213b164fdb456c1b19b98039365c8f0cf98 (diff)
downloadlibgit2-30640aa9ad574761a3a69244c6194eb626e69d40.tar.gz
rebase: identify a rebase that has not started
In `git_rebase_operation_current()`, indicate when a rebase has not started (with `GIT_REBASE_NO_OPERATION`) rather than conflating that with the first operation being in-progress.
Diffstat (limited to 'include')
-rw-r--r--include/git2/rebase.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/git2/rebase.h b/include/git2/rebase.h
index 58b66b7fa..3d8d180a5 100644
--- a/include/git2/rebase.h
+++ b/include/git2/rebase.h
@@ -89,6 +89,9 @@ typedef enum {
#define GIT_REBASE_OPTIONS_VERSION 1
#define GIT_REBASE_OPTIONS_INIT {GIT_REBASE_OPTIONS_VERSION}
+/** Indicates that a rebase operation is not (yet) in progress. */
+#define GIT_REBASE_NO_OPERATION SIZE_MAX
+
/**
* A rebase operation
*
@@ -170,6 +173,9 @@ GIT_EXTERN(size_t) git_rebase_operation_entrycount(git_rebase *rebase);
/**
* Gets the index of the rebase operation that is currently being applied.
+ * If the first operation has not yet been applied (because you have
+ * called `init` but not yet `next`) then this returns
+ * `GIT_REBASE_NO_OPERATION`.
*
* @param rebase The in-progress rebase
* @return The index of the rebase operation currently being applied.