Remove the HasUtils role from Repo.
Zachary Stevens [Tue, 10 Nov 2009 00:04:04 +0000 (00:04 +0000)]
lib/Gitalist/Controller/Root.pm
lib/Gitalist/Git/Repo.pm

index c880cbf..3a93e9a 100644 (file)
@@ -456,10 +456,10 @@ sub header {
   }
 
   $c->stash->{version}     = $Gitalist::VERSION;
-  $c->stash->{git_version} = $c->model('GitRepos')->run_cmd('--version');
+  # check git's version by running it on the first project in the list.
+  $c->stash->{git_version} = $c->model()->list_projects->[0]->run_cmd('--version');
   $c->stash->{title}       = $title;
 
-  #$c->stash->{baseurl} = $ENV{PATH_INFO} && uri_escape($base_url);
   $c->stash->{stylesheet} = $c->config->{stylesheet} || 'gitweb.css';
 
   $c->stash->{project} = $project;
index 3348bdd..e31ef3f 100644 (file)
@@ -1,17 +1,11 @@
 use MooseX::Declare;
 
-class Gitalist::Git::Repo with Gitalist::Git::HasUtils {
+class Gitalist::Git::Repo {
     use MooseX::Types::Common::String qw/NonEmptySimpleStr/;
     use MooseX::Types::Path::Class qw/Dir/;
     use MooseX::Types::Moose qw/ArrayRef/;
     use aliased 'Gitalist::Git::Project';
 
-    # FIXME - this is nasty as we build the Git::Utils thing without a project name
-    #         should refactor or something?
-    method _build__util {
-        Gitalist::Git::Util->new();
-    }
-
     has repo_dir => (
         isa => Dir,
         is => 'ro',