path: root/refs.h
diff options
authorJunio C Hamano <>2009-01-20 06:18:29 (GMT)
committerJunio C Hamano <>2009-01-20 06:18:29 (GMT)
commit101d15e09712a0183db99d228d975c62970654cf (patch)
tree794021ad7ade07c4835ec9c356930c637da26df7 /refs.h
parent39765e5941d36f74cec4764d315da0ba5743547c (diff)
Introduce for_each_recent_reflog_ent().
This can be used to scan only the last few kilobytes of a reflog, as a cheap optimization when the data you are looking for is likely to be found near the end of it. The caller is expected to fall back to the full scan if that is not the case. Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'refs.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/refs.h b/refs.h
index 06ad260..3bb529d 100644
--- a/refs.h
+++ b/refs.h
@@ -60,6 +60,7 @@ extern int read_ref_at(const char *ref, unsigned long at_time, int cnt, unsigned
/* iterate over reflog entries */
typedef int each_reflog_ent_fn(unsigned char *osha1, unsigned char *nsha1, const char *, unsigned long, int, const char *, void *);
int for_each_reflog_ent(const char *ref, each_reflog_ent_fn fn, void *cb_data);
+int for_each_recent_reflog_ent(const char *ref, each_reflog_ent_fn fn, long, void *cb_data);
* Calls the specified function for each reflog file until it returns nonzero,