Fix: webgit_log_table needs head parameter (previously removed)
authorChristian Thaeter <ct@pipapo.org>
Fri, 8 Feb 2008 07:45:53 +0000 (08:45 +0100)
committerChristian Thaeter <ct@pipapo.org>
Fri, 8 Feb 2008 07:45:53 +0000 (08:45 +0100)
src/actions.c
src/log.c
src/log.h

index 713b712..bf3e1a1 100644 (file)
@@ -265,7 +265,7 @@ webgit_summary_content_action (struct webgit_repo_info* repo)
                                                  html ("Log of branch '", repo->last_head, "'")
                                                  )
                                 ),
-                          webgit_log_table (repo->query, repo->last_head, 5 /*TODO: config this*/, 0))
+                          webgit_log_table (repo->query, repo->last_head, repo->last_head, 5 /*TODO: config this*/, 0))
                     );
 
 
index 7317f59..5deb978 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -73,7 +73,7 @@ webgit_log_menu_action (struct webgit_repo_info* repo)
 
 
 Html
-webgit_log_table (struct webgit_query* query, const char* object, int count, int verbosity)
+webgit_log_table (struct webgit_query* query, const char* head, const char* object, int count, int verbosity)
 {
   struct rev_info rev;
   const char* argv[] = {NULL, object, NULL};
@@ -105,8 +105,8 @@ webgit_log_table (struct webgit_query* query, const char* object, int count, int
                             webgit_log_link (
                                              query,
                                              query->repo,
-                                             query->head,
-                                             sha1_to_hex(commit->object.sha1), 40,
+                                             head,
+                                             sha1_to_hex (commit->object.sha1), 40,
                                              query->count_def,
                                              html("More..."))
                             );
@@ -143,7 +143,7 @@ webgit_log_table (struct webgit_query* query, const char* object, int count, int
                                              ),
                                    webgit_object_link (query, webgit_object_commit_header_parse (commit),
                                                        "repo", query->repo,
-                                                       "ref", query->head,
+                                                       "ref", head,
                                                        "commit", sha1_to_hex (commit->object.sha1))
                                    ),
                               // TODO please refactor this if it's really silly
@@ -165,7 +165,7 @@ webgit_log_table (struct webgit_query* query, const char* object, int count, int
                                                " ",
                                                webgit_object_link (query, html ("Tree"),
                                                                    "repo", query->repo,
-                                                                   "ref", query->head,
+                                                                   "ref", head,
                                                                    "commit", webgit_object_commit_tree_parse (commit),
                                                                    "path", "")
                                                )
@@ -219,7 +219,7 @@ webgit_log_content_action (struct webgit_repo_info* repo)
   else
     object = "HEAD";
 
-  return webgit_log_table (query, object, query->count, 2);
+  return webgit_log_table (query, query->head, object, query->count, 2);
 }
 
 /*
index 89959a0..fd34cb3 100644 (file)
--- a/src/log.h
+++ b/src/log.h
@@ -37,7 +37,7 @@ Html
 webgit_log_content_action (struct webgit_repo_info* repo);
 
 Html
-webgit_log_table (struct webgit_query* query, const char* object, int count, int msg_flag);
+webgit_log_table (struct webgit_query* query, const char* head, const char* object, int count, int msg_flag);
 
 #endif