From 8a65ff7666db1299449a397bab3d39d74b82aa54 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 2 Jul 2005 20:23:36 -0700 Subject: Generalize the "show each ref" code in receice-pack This turns it into a generic "do xyz for each ref" library function. --- refs.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'refs.h') 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); -- cgit v1.2.3