root/git/ui-refs.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. dump_refs

   1 #include <stdio.h>
   2 #include <string.h>
   3 #include <git2.h>
   4 
   5 #include "html.h"
   6 #include "ui-refs.h"
   7 #include "git.h"
   8 
   9 /* TODO: support tags? */
  10 
  11 void
  12 dump_refs(void) {
  13         git_reference_iterator *iter;
  14         git_reference *ref;
  15         git_commit *commit;
  16 
  17         check_sgerr(git_reference_iterator_new(&iter, grepo));
  18 
  19         html_table_begin(4, "Branch", "Message", "Author", "Date");
  20         while (!git_reference_next(&ref, iter)) {
  21                 commit = NULL;
  22                 git_commit_lookup(&commit, grepo,
  23                     git_reference_target(ref));
  24                 if (!commit) goto dump_refs_continue;
  25 
  26                 html("<tr>\n\
  27   <td class=\"git-flat\">%s</td>\n\
  28   <td class=\"git-long\">%s</td>\n\
  29   <td class=\"git-flat\">%s</td>\n\
  30   <td class=\"git-flat\">%s</td>\n\
  31 </tr>\n",
  32                     my_html_make_link(
  33     make_query_simple(T_LOG, git_commit_id(commit), NULL),
  34     git_reference_name(ref)),
  35                     my_html_encode(git_commit_summary(commit)),
  36                     my_html_encode(git_commit_author(commit)->name),
  37                     check_sptr(readable_time(git_commit_time(commit)))
  38                 );
  39                 git_commit_free(commit);
  40  dump_refs_continue:
  41                 git_reference_free(ref);
  42         }
  43         git_reference_iterator_free(iter);
  44         html_table_end();
  45 }

/* [previous][next][first][last][top][bottom][index][help] */