21 char oid[GIT_OID_HEXSZ + 1];
22 char parentoid[GIT_OID_HEXSZ + 1];
24 const git_signature *author;
28 git_diff_stats *stats;
32 git_tree *commit_tree;
33 git_tree *parent_tree;
40 static git_repository *repo;
42 static const char *relpath = "";
43 static const char *repodir;
45 static char name[255];
46 static char description[255];
47 static char cloneurl[1024];
48 static int hasreadme, haslicense;
51 commitinfo_free(struct commitinfo *ci)
56 git_diff_stats_free(ci->stats);
57 git_diff_free(ci->diff);
58 git_tree_free(ci->commit_tree);
59 git_tree_free(ci->parent_tree);
60 git_commit_free(ci->commit);
64 commitinfo_getbyoid(const git_oid *id)
66 struct commitinfo *ci;
67 git_diff_options opts;
70 if (!(ci = calloc(1, sizeof(struct commitinfo))))
74 if (git_commit_lookup(&(ci->commit), repo, id))
77 git_oid_tostr(ci->oid, sizeof(ci->oid), git_commit_id(ci->commit));
78 git_oid_tostr(ci->parentoid, sizeof(ci->parentoid), git_commit_parent_id(ci->commit, 0));
80 ci->author = git_commit_author(ci->commit);
81 ci->summary = git_commit_summary(ci->commit);
82 ci->msg = git_commit_message(ci->commit);
84 if ((error = git_commit_tree(&(ci->commit_tree), ci->commit)))
86 if (!(error = git_commit_parent(&(ci->parent), ci->commit, 0))) {
87 if ((error = git_commit_tree(&(ci->parent_tree), ci->parent)))
91 ci->parent_tree = NULL;
94 git_diff_init_options(&opts, GIT_DIFF_OPTIONS_VERSION);
95 opts.flags |= GIT_DIFF_DISABLE_PATHSPEC_MATCH;
96 if ((error = git_diff_tree_to_tree(&(ci->diff), repo, ci->parent_tree, ci->commit_tree, &opts)))
98 if (git_diff_get_stats(&(ci->stats), ci->diff))
101 ci->addcount = git_diff_stats_insertions(ci->stats);
102 ci->delcount = git_diff_stats_deletions(ci->stats);
103 ci->filecount = git_diff_stats_files_changed(ci->stats);
115 efopen(const char *name, const char *flags)
119 if (!(fp = fopen(name, flags)))
125 /* Escape characters below as HTML 2.0 / XML 1.0. */
127 xmlencode(FILE *fp, const char *s, size_t len)
131 for (i = 0; *s && i < len; s++, i++) {
133 case '<': fputs("<", fp); break;
134 case '>': fputs(">", fp); break;
135 case '\'': fputs("'", fp); break;
136 case '&': fputs("&", fp); break;
137 case '"': fputs(""", fp); break;
138 default: fputc(*s, fp);
143 /* Some implementations of dirname(3) return a pointer to a static
144 * internal buffer (OpenBSD). Others modify the contents of `path` (POSIX).
145 * This is a wrapper function that is compatible with both versions.
146 * The program will error out if dirname(3) failed, this can only happen
147 * with the OpenBSD version. */
149 xdirname(const char *path)
153 if (!(p = strdup(path)))
155 if (!(b = dirname(p)))
157 if (!(b = strdup(b)))
164 /* Some implementations of basename(3) return a pointer to a static
165 * internal buffer (OpenBSD). Others modify the contents of `path` (POSIX).
166 * This is a wrapper function that is compatible with both versions.
167 * The program will error out if basename(3) failed, this can only happen
168 * with the OpenBSD version. */
170 xbasename(const char *path)
174 if (!(p = strdup(path)))
176 if (!(b = basename(p)))
178 if (!(b = strdup(b)))
186 mkdirp(const char *path)
188 char tmp[PATH_MAX], *p;
190 strlcpy(tmp, path, sizeof(tmp));
191 for (p = tmp + (tmp[0] == '/'); *p; p++) {
195 if (mkdir(tmp, S_IRWXU | S_IRWXG | S_IRWXO) < 0 && errno != EEXIST)
199 if (mkdir(tmp, S_IRWXU | S_IRWXG | S_IRWXO) < 0 && errno != EEXIST)
205 printtimeformat(FILE *fp, const git_time *intime, const char *fmt)
211 t = (time_t) intime->time + (intime->offset * 60);
213 strftime(out, sizeof(out), fmt, intm);
218 printtimez(FILE *fp, const git_time *intime)
220 printtimeformat(fp, intime, "%Y-%m-%dT%H:%M:%SZ");
224 printtime(FILE *fp, const git_time *intime)
226 printtimeformat(fp, intime, "%a %b %e %T %Y");
230 printtimeshort(FILE *fp, const git_time *intime)
232 printtimeformat(fp, intime, "%Y-%m-%d %H:%M");
236 writeheader(FILE *fp)
238 fputs("<!DOCTYPE HTML>"
239 "<html dir=\"ltr\" lang=\"en\">\n<head>\n"
240 "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n"
241 "<meta http-equiv=\"Content-Language\" content=\"en\" />\n<title>", fp);
242 xmlencode(fp, name, strlen(name));
245 xmlencode(fp, description, strlen(description));
246 fprintf(fp, "</title>\n<link rel=\"icon\" type=\"image/png\" href=\"%sfavicon.png\" />\n", relpath);
247 fprintf(fp, "<link rel=\"alternate\" type=\"application/atom+xml\" title=\"%s Atom Feed\" href=\"%satom.xml\" />\n",
249 fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"%sstyle.css\" />\n", relpath);
250 fputs("</head>\n<body>\n<table><tr><td>", fp);
251 fprintf(fp, "<a href=\"../%s\"><img src=\"%slogo.png\" alt=\"\" width=\"32\" height=\"32\" /></a>",
253 fputs("</td><td><h1>", fp);
254 xmlencode(fp, name, strlen(name));
255 fputs("</h1><span class=\"desc\">", fp);
256 xmlencode(fp, description, strlen(description));
257 fputs("</span></td></tr>", fp);
259 fputs("<tr class=\"url\"><td></td><td>git clone <a href=\"", fp);
260 xmlencode(fp, cloneurl, strlen(cloneurl));
262 xmlencode(fp, cloneurl, strlen(cloneurl));
263 fputs("</a></td></tr>", fp);
265 fputs("<tr><td></td><td>\n", fp);
266 fprintf(fp, "<a href=\"%slog.html\">Log</a> | ", relpath);
267 fprintf(fp, "<a href=\"%sfiles.html\">Files</a> | ", relpath);
268 fprintf(fp, "<a href=\"%srefs.html\">Refs/branches</a>", relpath);
270 fprintf(fp, " | <a href=\"%sfile/README.html\">README</a>", relpath);
272 fprintf(fp, " | <a href=\"%sfile/LICENSE.html\">LICENSE</a>", relpath);
273 fputs("</td></tr></table>\n<hr/>\n<div id=\"content\">\n", fp);
279 writefooter(FILE *fp)
281 return !fputs("</div>\n</body>\n</html>\n", fp);
285 writeblobhtml(FILE *fp, const git_blob *blob)
289 char *nfmt = "<a href=\"#l%d\" id=\"l%d\">%d</a>\n";
290 const char *s = git_blob_rawcontent(blob);
291 git_off_t len = git_blob_rawsize(blob);
293 fputs("<table id=\"blob\"><tr><td class=\"num\"><pre>\n", fp);
296 fprintf(fp, nfmt, n, n, n);
297 for (i = 0; i < len - 1; i++) {
300 fprintf(fp, nfmt, n, n, n);
305 fputs("</pre></td><td><pre>\n", fp);
306 xmlencode(fp, s, (size_t)len);
307 fputs("</pre></td></tr></table>\n", fp);
311 printcommit(FILE *fp, struct commitinfo *ci)
313 fprintf(fp, "<b>commit</b> <a href=\"%scommit/%s.html\">%s</a>\n",
314 relpath, ci->oid, ci->oid);
316 if (ci->parentoid[0])
317 fprintf(fp, "<b>parent</b> <a href=\"%scommit/%s.html\">%s</a>\n",
318 relpath, ci->parentoid, ci->parentoid);
321 fputs("<b>Author:</b> ", fp);
322 xmlencode(fp, ci->author->name, strlen(ci->author->name));
323 fputs(" <<a href=\"mailto:", fp);
324 xmlencode(fp, ci->author->email, strlen(ci->author->email));
326 xmlencode(fp, ci->author->email, strlen(ci->author->email));
327 fputs("</a>>\n<b>Date:</b> ", fp);
328 printtime(fp, &(ci->author->when));
334 xmlencode(fp, ci->msg, strlen(ci->msg));
340 printshowfile(struct commitinfo *ci)
342 const git_diff_delta *delta;
343 const git_diff_hunk *hunk;
344 const git_diff_line *line;
347 size_t ndeltas, nhunks, nhunklines;
352 snprintf(path, sizeof(path), "commit/%s.html", ci->oid);
353 /* check if file exists if so skip it */
354 if (!access(path, F_OK))
357 fp = efopen(path, "w");
359 fputs("<pre>\n", fp);
362 memset(&statsbuf, 0, sizeof(statsbuf));
366 if (!git_diff_stats_to_buf(&statsbuf, ci->stats,
367 GIT_DIFF_STATS_FULL | GIT_DIFF_STATS_SHORT, 80)) {
368 if (statsbuf.ptr && statsbuf.ptr[0]) {
369 fputs("<b>Diffstat:</b>\n", fp);
370 fputs(statsbuf.ptr, fp);
377 ndeltas = git_diff_num_deltas(ci->diff);
378 for (i = 0; i < ndeltas; i++) {
379 if (git_patch_from_diff(&patch, ci->diff, i)) {
380 git_patch_free(patch);
384 delta = git_patch_get_delta(patch);
385 fprintf(fp, "<b>diff --git a/<a href=\"%sfile/%s.html\">%s</a> b/<a href=\"%sfile/%s.html\">%s</a></b>\n",
386 relpath, delta->old_file.path, delta->old_file.path,
387 relpath, delta->new_file.path, delta->new_file.path);
389 /* check binary data */
390 if (delta->flags & GIT_DIFF_FLAG_BINARY) {
391 fputs("Binary files differ\n", fp);
392 git_patch_free(patch);
396 nhunks = git_patch_num_hunks(patch);
397 for (j = 0; j < nhunks; j++) {
398 if (git_patch_get_hunk(&hunk, &nhunklines, patch, j))
401 fprintf(fp, "<a href=\"#h%zu\" id=\"h%zu\" class=\"h\">", j, j);
402 xmlencode(fp, hunk->header, hunk->header_len);
406 if (git_patch_get_line_in_hunk(&line, patch, j, k))
408 if (line->old_lineno == -1)
409 fprintf(fp, "<a href=\"#h%zu-%zu\" id=\"h%zu-%zu\" class=\"i\">+",
411 else if (line->new_lineno == -1)
412 fprintf(fp, "<a href=\"#h%zu-%zu\" id=\"h%zu-%zu\" class=\"d\">-",
416 xmlencode(fp, line->content, line->content_len);
417 if (line->old_lineno == -1 || line->new_lineno == -1)
421 git_patch_free(patch);
423 git_buf_free(&statsbuf);
425 fputs("</pre>\n", fp);
432 writelog(FILE *fp, const char *branch)
434 struct commitinfo *ci;
436 git_revwalk *w = NULL;
437 git_object *obj = NULL;
441 mkdir("commit", 0755);
443 if (git_revparse_single(&obj, repo, branch))
445 oid = git_object_id(obj);
447 git_revwalk_new(&w, repo);
448 git_revwalk_push(w, oid);
449 git_revwalk_sorting(w, GIT_SORT_TIME);
450 git_revwalk_simplify_first_parent(w);
452 fputs("<table id=\"log\"><thead>\n<tr><td>Age</td><td>Commit message</td>"
453 "<td>Author</td><td>Files</td><td class=\"num\">+</td>"
454 "<td class=\"num\">-</td></tr>\n</thead><tbody>\n", fp);
456 while (!git_revwalk_next(&id, w)) {
459 if (!(ci = commitinfo_getbyoid(&id)))
462 fputs("<tr><td>", fp);
464 printtimeshort(fp, &(ci->author->when));
465 fputs("</td><td>", fp);
467 fprintf(fp, "<a href=\"%scommit/%s.html\">", relpath, ci->oid);
468 if ((len = strlen(ci->summary)) > summarylen) {
469 xmlencode(fp, ci->summary, summarylen - 1);
472 xmlencode(fp, ci->summary, len);
476 fputs("</td><td>", fp);
478 xmlencode(fp, ci->author->name, strlen(ci->author->name));
479 fputs("</td><td class=\"num\">", fp);
480 fprintf(fp, "%zu", ci->filecount);
481 fputs("</td><td class=\"num\">", fp);
482 fprintf(fp, "+%zu", ci->addcount);
483 fputs("</td><td class=\"num\">", fp);
484 fprintf(fp, "-%zu", ci->delcount);
485 fputs("</td></tr>\n", fp);
492 fputs("</tbody></table>", fp);
495 git_object_free(obj);
503 printcommitatom(FILE *fp, struct commitinfo *ci)
505 fputs("<entry>\n", fp);
507 fprintf(fp, "<id>%s</id>\n", ci->oid);
509 fputs("<updated>", fp);
510 printtimez(fp, &(ci->author->when));
511 fputs("</updated>\n", fp);
514 fputs("<title type=\"text\">", fp);
515 xmlencode(fp, ci->summary, strlen(ci->summary));
516 fputs("</title>\n", fp);
519 fputs("<content type=\"text\">", fp);
520 fprintf(fp, "commit %s\n", ci->oid);
521 if (ci->parentoid[0])
522 fprintf(fp, "parent %s\n", ci->parentoid);
524 fputs("Author: ", fp);
525 xmlencode(fp, ci->author->name, strlen(ci->author->name));
527 xmlencode(fp, ci->author->email, strlen(ci->author->email));
528 fputs(">\nDate: ", fp);
529 printtime(fp, &(ci->author->when));
534 xmlencode(fp, ci->msg, strlen(ci->msg));
535 fputs("\n</content>\n", fp);
537 fputs("<author><name>", fp);
538 xmlencode(fp, ci->author->name, strlen(ci->author->name));
539 fputs("</name>\n<email>", fp);
540 xmlencode(fp, ci->author->email, strlen(ci->author->email));
541 fputs("</email>\n</author>\n", fp);
543 fputs("</entry>\n", fp);
549 struct commitinfo *ci;
550 git_revwalk *w = NULL;
552 size_t i, m = 100; /* max */
554 fputs("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
555 "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n<title>", fp);
556 xmlencode(fp, name, strlen(name));
557 fputs(", branch master</title>\n<subtitle>", fp);
559 xmlencode(fp, description, strlen(description));
560 fputs("</subtitle>\n", fp);
562 git_revwalk_new(&w, repo);
563 git_revwalk_push_head(w);
564 git_revwalk_sorting(w, GIT_SORT_TIME);
565 git_revwalk_simplify_first_parent(w);
567 for (i = 0; i < m && !git_revwalk_next(&id, w); i++) {
568 if (!(ci = commitinfo_getbyoid(&id)))
570 printcommitatom(fp, ci);
575 fputs("</feed>", fp);
581 writeblob(git_object *obj, const char *filename, git_off_t filesize)
583 char fpath[PATH_MAX];
584 char tmp[PATH_MAX] = "";
588 snprintf(fpath, sizeof(fpath), "file/%s.html", filename);
599 strlcat(tmp, "../", sizeof(tmp));
604 fp = efopen(fpath, "w");
607 xmlencode(fp, filename, strlen(filename));
608 fprintf(fp, " (%jub)", (uintmax_t)filesize);
609 fputs("</p><hr/>", fp);
611 if (git_blob_is_binary((git_blob *)obj)) {
612 fputs("<p>Binary file</p>\n", fp);
614 writeblobhtml(fp, (git_blob *)obj);
627 filemode(git_filemode_t m)
629 static char mode[11];
631 memset(mode, '-', sizeof(mode) - 1);
642 else if (S_ISFIFO(m))
646 else if (S_ISSOCK(m))
651 if (m & S_IRUSR) mode[1] = 'r';
652 if (m & S_IWUSR) mode[2] = 'w';
653 if (m & S_IXUSR) mode[3] = 'x';
654 if (m & S_IRGRP) mode[4] = 'r';
655 if (m & S_IWGRP) mode[5] = 'w';
656 if (m & S_IXGRP) mode[6] = 'x';
657 if (m & S_IROTH) mode[7] = 'r';
658 if (m & S_IWOTH) mode[8] = 'w';
659 if (m & S_IXOTH) mode[9] = 'x';
661 if (m & S_ISUID) mode[3] = (mode[3] == 'x') ? 's' : 'S';
662 if (m & S_ISGID) mode[6] = (mode[6] == 'x') ? 's' : 'S';
663 if (m & S_ISVTX) mode[9] = (mode[9] == 'x') ? 't' : 'T';
669 writefilestree(FILE *fp, git_tree *tree, const char *branch, const char *path)
671 const git_tree_entry *entry = NULL;
672 const char *filename;
673 char filepath[PATH_MAX];
674 git_object *obj = NULL;
679 count = git_tree_entrycount(tree);
680 for (i = 0; i < count; i++) {
681 if (!(entry = git_tree_entry_byindex(tree, i)) ||
682 git_tree_entry_to_object(&obj, repo, entry))
684 filename = git_tree_entry_name(entry);
685 switch (git_object_type(obj)) {
690 ret = writefilestree(fp, (git_tree *)obj, branch,
692 git_object_free(obj);
697 git_object_free(obj);
701 snprintf(filepath, sizeof(filepath), "%s/%s",
705 filesize = git_blob_rawsize((git_blob *)obj);
707 fputs("<tr><td>", fp);
708 fprintf(fp, "%s", filemode(git_tree_entry_filemode(entry)));
709 fprintf(fp, "</td><td><a href=\"%sfile/", relpath);
710 xmlencode(fp, filename, strlen(filename));
711 fputs(".html\">", fp);
712 xmlencode(fp, filename, strlen(filename));
713 fputs("</a></td><td class=\"num\">", fp);
714 fprintf(fp, "%ju", (uintmax_t)filesize);
715 fputs("</td></tr>\n", fp);
717 writeblob(obj, filename, filesize);
724 writefiles(FILE *fp, const char *branch)
727 git_tree *tree = NULL;
728 git_object *obj = NULL;
729 git_commit *commit = NULL;
732 fputs("<table id=\"files\"><thead>\n<tr>"
733 "<td>Mode</td><td>Name</td><td class=\"num\">Size</td>"
734 "</tr>\n</thead><tbody>\n", fp);
736 if (git_revparse_single(&obj, repo, branch))
738 id = git_object_id(obj);
739 if (git_commit_lookup(&commit, repo, id) ||
740 git_commit_tree(&tree, commit))
742 ret = writefilestree(fp, tree, branch, "");
745 fputs("</tbody></table>", fp);
747 git_object_free(obj);
748 git_commit_free(commit);
755 refs_cmp(const void *v1, const void *v2)
757 git_reference *r1 = (*(git_reference **)v1);
758 git_reference *r2 = (*(git_reference **)v2);
761 t1 = git_reference_is_branch(r1);
762 t2 = git_reference_is_branch(r2);
767 return strcmp(git_reference_shorthand(r1),
768 git_reference_shorthand(r2));
774 struct commitinfo *ci;
775 const git_oid *id = NULL;
776 git_object *obj = NULL;
777 git_reference *dref = NULL, *r, *ref = NULL;
778 git_reference_iterator *it = NULL;
779 git_reference **refs = NULL;
780 size_t count, i, j, len, refcount = 0;
781 const char *cols[] = { "Branch", "Tag" }; /* first column title */
782 const char *titles[] = { "Branches", "Tags" };
783 const char *ids[] = { "branches", "tags" };
786 if (git_reference_iterator_new(&it, repo))
789 for (refcount = 0; !git_reference_next(&ref, it); refcount++) {
790 if (!(refs = reallocarray(refs, refcount + 1, sizeof(git_reference *))))
792 refs[refcount] = ref;
794 git_reference_iterator_free(it);
796 /* sort by type then shorthand name */
797 qsort(refs, refcount, sizeof(git_reference *), refs_cmp);
799 for (j = 0; j < 2; j++) {
800 for (i = 0, count = 0; i < refcount; i++) {
801 if (!(git_reference_is_branch(refs[i]) && j == 0) &&
802 !(git_reference_is_tag(refs[i]) && j == 1))
805 switch (git_reference_type(refs[i])) {
806 case GIT_REF_SYMBOLIC:
807 if (git_reference_resolve(&dref, refs[i]))
817 if (!(id = git_reference_target(r)))
819 if (git_reference_peel(&obj, r, GIT_OBJ_ANY))
821 if (!(id = git_object_id(obj)))
823 if (!(ci = commitinfo_getbyoid(id)))
826 /* print header if it has an entry (first). */
828 fprintf(fp, "<h2>%s</h2><table id=\"%s\"><thead>\n<tr><td>%s</td>"
829 "<td>Age</td><td>Commit message</td>"
830 "<td>Author</td><td>Files</td><td class=\"num\">+</td>"
831 "<td class=\"num\">-</td></tr>\n</thead><tbody>\n",
832 titles[j], ids[j], cols[j]);
836 name = git_reference_shorthand(r);
838 fputs("<tr><td>", fp);
839 xmlencode(fp, name, strlen(name));
840 fputs("</td><td>", fp);
842 printtimeshort(fp, &(ci->author->when));
843 fputs("</td><td>", fp);
846 fprintf(fp, "<a href=\"%scommit/%s.html\">",
848 if ((len = strlen(ci->summary)) > summarylen) {
849 xmlencode(fp, ci->summary, summarylen - 1);
852 xmlencode(fp, ci->summary, len);
857 fputs("</td><td>", fp);
859 xmlencode(fp, ci->author->name, strlen(ci->author->name));
860 fputs("</td><td class=\"num\">", fp);
861 fprintf(fp, "%zu", ci->filecount);
862 fputs("</td><td class=\"num\">", fp);
863 fprintf(fp, "+%zu", ci->addcount);
864 fputs("</td><td class=\"num\">", fp);
865 fprintf(fp, "-%zu", ci->delcount);
866 fputs("</td></tr>\n", fp);
871 git_object_free(obj);
873 git_reference_free(dref);
878 fputs("</tbody></table>", fp);
882 git_object_free(obj);
883 git_reference_free(dref);
885 for (i = 0; i < refcount; i++)
886 git_reference_free(refs[i]);
893 main(int argc, char *argv[])
895 git_object *obj = NULL;
896 const git_error *e = NULL;
898 char path[PATH_MAX], *p;
902 fprintf(stderr, "%s <repodir>\n", argv[0]);
909 if ((status = git_repository_open_ext(&repo, repodir,
910 GIT_REPOSITORY_OPEN_NO_SEARCH, NULL)) < 0) {
912 fprintf(stderr, "error %d/%d: %s\n", status, e->klass, e->message);
916 /* use directory name as name */
917 p = xbasename(repodir);
918 snprintf(name, sizeof(name), "%s", p);
921 /* read description or .git/description */
922 snprintf(path, sizeof(path), "%s%s%s",
923 repodir, repodir[strlen(repodir)] == '/' ? "" : "/", "description");
924 if (!(fpread = fopen(path, "r"))) {
925 snprintf(path, sizeof(path), "%s%s%s",
926 repodir, repodir[strlen(repodir)] == '/' ? "" : "/", ".git/description");
927 fpread = fopen(path, "r");
930 if (!fgets(description, sizeof(description), fpread))
931 description[0] = '\0';
935 /* read url or .git/url */
936 snprintf(path, sizeof(path), "%s%s%s",
937 repodir, repodir[strlen(repodir)] == '/' ? "" : "/", "url");
938 if (!(fpread = fopen(path, "r"))) {
939 snprintf(path, sizeof(path), "%s%s%s",
940 repodir, repodir[strlen(repodir)] == '/' ? "" : "/", ".git/url");
941 fpread = fopen(path, "r");
944 if (!fgets(cloneurl, sizeof(cloneurl), fpread))
946 cloneurl[strcspn(cloneurl, "\n")] = '\0';
951 haslicense = !git_revparse_single(&obj, repo, "HEAD:LICENSE");
952 git_object_free(obj);
954 hasreadme = !git_revparse_single(&obj, repo, "HEAD:README");
955 git_object_free(obj);
958 fp = efopen("log.html", "w");
961 writelog(fp, "HEAD");
966 fp = efopen("files.html", "w");
968 writefiles(fp, "HEAD");
972 /* summary page with branches and tags */
973 fp = efopen("refs.html", "w");
980 fp = efopen("atom.xml", "w");
985 git_repository_free(repo);
986 git_libgit2_shutdown();