@@ -61,6 +61,24 @@ GIT_EXTERN(int) git_stash_save(
6161 const char * message ,
6262 unsigned int flags );
6363
64+ /**
65+ * Apply a single stashed state from the stash list.
66+ *
67+ * @param repo The owning repository.
68+ *
69+ * @param index The position within the stash list. 0 points to the
70+ * most recent stashed state.
71+ *
72+ * @param reinstate_index Try to reinstate not only the working tree's changes,
73+ * but also the index's ones.
74+ *
75+ * @return 0 on success, or error code
76+ */
77+ GIT_EXTERN (int ) git_stash_apply (
78+ git_repository * repo ,
79+ size_t index ,
80+ int reinstate_index );
81+
6482/**
6583 * This is a callback function you can provide to iterate over all the
6684 * stashed states that will be invoked per entry.
@@ -107,11 +125,29 @@ GIT_EXTERN(int) git_stash_foreach(
107125 *
108126 * @return 0 on success, or error code
109127 */
110-
111128GIT_EXTERN (int ) git_stash_drop (
112129 git_repository * repo ,
113130 size_t index );
114131
132+ /**
133+ * Apply a single stashed state from the stash list and remove it from the list
134+ * if successful.
135+ *
136+ * @param repo The owning repository.
137+ *
138+ * @param index The position within the stash list. 0 points to the
139+ * most recent stashed state.
140+ *
141+ * @param reinstate_index Try to reinstate not only the working tree's changes,
142+ * but also the index's ones.
143+ *
144+ * @return 0 on success, or error code
145+ */
146+ GIT_EXTERN (int ) git_stash_pop (
147+ git_repository * repo ,
148+ size_t index ,
149+ int reinstate_index );
150+
115151/** @} */
116152GIT_END_DECL
117153#endif
0 commit comments