Make getting the version of git we're running not imply getting all the projects
Tomas Doran [Wed, 11 Nov 2009 01:30:52 +0000 (01:30 +0000)]
lib/Gitalist/Controller/Root.pm

index c8f5b58..44a5a8d 100644 (file)
@@ -458,7 +458,6 @@ sub header {
 
   $c->stash->{version}     = $Gitalist::VERSION;
   # check git's version by running it on the first project in the list.
-  $c->stash->{git_version} = $c->model()->projects->[0]->run_cmd('--version');
   $c->stash->{title}       = $title;
 
   $c->stash->{stylesheet} = $c->config->{stylesheet} || 'gitweb.css';
@@ -528,6 +527,8 @@ sub header {
                                    || 'HEAD' ),
       );
   }
+  my $a_project = $c->stash->{Project} || $c->model()->projects->[0];
+  $c->stash->{git_version} = $a_project->run_cmd('--version');
 }
 
 # Formally git_footer_html