summaryrefslogtreecommitdiff
path: root/include/git2/reflog.h
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2012-11-17 18:29:51 -0800
committernulltoken <emeric.fermas@gmail.com>2012-11-17 18:30:35 -0800
commitb15df1d937128bb7051ab35084195ff1980a7869 (patch)
treeccac67d86df9f6f8f2276d2b4f4b43555e99b20e /include/git2/reflog.h
parent1a764476d27ac1861d1433b02bc7fbff733d8942 (diff)
downloadlibgit2-b15df1d937128bb7051ab35084195ff1980a7869.tar.gz
reflog: make entry_byindex() and drop() git compliant
Passing 0 as the index now retrieves the most recent entry instead of the oldest one.
Diffstat (limited to 'include/git2/reflog.h')
-rw-r--r--include/git2/reflog.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/git2/reflog.h b/include/git2/reflog.h
index 20e0f3319..72e1f1753 100644
--- a/include/git2/reflog.h
+++ b/include/git2/reflog.h
@@ -88,8 +88,12 @@ GIT_EXTERN(unsigned int) git_reflog_entrycount(git_reflog *reflog);
/**
* Lookup an entry by its index
*
+ * Requesting the reflog entry with an index of 0 (zero) will
+ * return the most recently created entry.
+ *
* @param reflog a previously loaded reflog
- * @param idx the position to lookup
+ * @param idx the position of the entry to lookup. Should be greater than or
+ * equal to 0 (zero) and less than `git_reflog_entrycount()`.
* @return the entry; NULL if not found
*/
GIT_EXTERN(const git_reflog_entry *) git_reflog_entry_byindex(git_reflog *reflog, size_t idx);
@@ -103,7 +107,8 @@ GIT_EXTERN(const git_reflog_entry *) git_reflog_entry_byindex(git_reflog *reflog
*
* @param reflog a previously loaded reflog.
*
- * @param idx the position of the entry to remove.
+ * @param idx the position of the entry to remove. Should be greater than or
+ * equal to 0 (zero) and less than `git_reflog_entrycount()`.
*
* @param rewrite_previous_entry 1 to rewrite the history; 0 otherwise.
*
@@ -112,7 +117,7 @@ GIT_EXTERN(const git_reflog_entry *) git_reflog_entry_byindex(git_reflog *reflog
*/
GIT_EXTERN(int) git_reflog_drop(
git_reflog *reflog,
- unsigned int idx,
+ size_t idx,
int rewrite_previous_entry);
/**