+static char *match_path;
+static unsigned char *matched_sha1;
+static int found_path;
+
+static int walk_tree(const unsigned char *sha1, const char *base,int baselen,
+ const char *pathname, unsigned mode, int stage, void *cbdata) {
+ if(strncmp(base,match_path,baselen)
+ || strcmp(match_path+baselen,pathname) )
+ return READ_TREE_RECURSIVE;
+ memmove(matched_sha1,sha1,20);
+ found_path = 1;
+ return 0;
+}
+
+int cgit_print_file(char *path, const char *head)