+struct ref_lock {
+ char *ref_file;
+ char *log_file;
+ struct lock_file *lk;
+ unsigned char old_sha1[20];
+ int lock_fd;
+ int force_write;
+};
+
+/*
+ * Calls the specified function for each ref file until it returns nonzero,
+ * and returns the value
+ */
+extern int head_ref(int (*fn)(const char *path, const unsigned char *sha1));
+extern int for_each_ref(int (*fn)(const char *path, const unsigned char *sha1));
+extern int for_each_tag_ref(int (*fn)(const char *path, const unsigned char *sha1));
+extern int for_each_branch_ref(int (*fn)(const char *path, const unsigned char *sha1));
+extern int for_each_remote_ref(int (*fn)(const char *path, const unsigned char *sha1));
+