API updates for stash.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
diff --git a/include/git2/stash.h b/include/git2/stash.h
index 3ecd9e8..b57d47b 100644
--- a/include/git2/stash.h
+++ b/include/git2/stash.h
@@ -18,7 +18,7 @@
*/
GIT_BEGIN_DECL
-enum {
+typedef enum {
GIT_STASH_DEFAULT = 0,
/* All changes already added to the index
@@ -35,7 +35,7 @@ enum {
* cleaned up from the working directory
*/
GIT_STASH_INCLUDE_IGNORED = (1 << 2),
-};
+} git_stash_flags;
/**
* Save the local modifications to a new stash.
@@ -49,18 +49,17 @@ enum {
*
* @param message Optional description along with the stashed state.
*
- * @param flags Flags to control the stashing process.
+ * @param flags Flags to control the stashing process. (see GIT_STASH_* above)
*
* @return 0 on success, GIT_ENOTFOUND where there's nothing to stash,
* or error code.
*/
-
GIT_EXTERN(int) git_stash_save(
git_oid *out,
git_repository *repo,
git_signature *stasher,
const char *message,
- uint32_t flags);
+ unsigned int flags);
/**
* When iterating over all the stashed states, callback that will be
@@ -71,16 +70,16 @@ GIT_EXTERN(int) git_stash_save(
*
* @param message The stash message.
*
- * @param stash_oid The commit oid of the stashed state.
+ * @param stash_id The commit oid of the stashed state.
*
* @param payload Extra parameter to callback function.
*
* @return 0 on success, GIT_EUSER on non-zero callback, or error code
*/
-typedef int (*stash_cb)(
+typedef int (*git_stash_cb)(
size_t index,
const char* message,
- const git_oid *stash_oid,
+ const git_oid *stash_id,
void *payload);
/**
@@ -99,7 +98,7 @@ typedef int (*stash_cb)(
*/
GIT_EXTERN(int) git_stash_foreach(
git_repository *repo,
- stash_cb callback,
+ git_stash_cb callback,
void *payload);
/**
diff --git a/src/stash.c b/src/stash.c
index b16637e..107cbe3 100644
--- a/src/stash.c
+++ b/src/stash.c
@@ -579,7 +579,7 @@ cleanup:
int git_stash_foreach(
git_repository *repo,
- stash_cb callback,
+ git_stash_cb callback,
void *payload)
{
git_reference *stash;