summaryrefslogtreecommitdiff
path: root/refs.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-07-02 20:23:36 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-02 20:23:36 -0700
commit8a65ff7666db1299449a397bab3d39d74b82aa54 (patch)
treeb0f9407b07ab00a4de734f39affaf3805c54c27e /refs.h
parentad8c80a58f7bf8f7d5d34794355e5540cd7b3218 (diff)
downloadgit-8a65ff7666db1299449a397bab3d39d74b82aa54.tar.gz
Generalize the "show each ref" code in receice-pack
This turns it into a generic "do xyz for each ref" library function.
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/refs.h b/refs.h
index 60cf48086f..7565decb0f 100644
--- a/refs.h
+++ b/refs.h
@@ -1,6 +1,12 @@
#ifndef REFS_H
#define REFS_H
+/*
+ * Calls the specified function for each ref file until it returns nonzero,
+ * and returns the value
+ */
+extern int for_each_ref(int (*fn)(const char *path, unsigned char *sha1));
+
/** Reads the refs file specified into sha1 **/
extern int get_ref_sha1(const char *ref, unsigned char *sha1);