Straightened up the model test and corresponding code.
[catagits/Gitalist.git] / lib / Gitalist / Controller / Root.pm
index 394d64d..bcdc3d0 100644 (file)
@@ -46,11 +46,11 @@ sub run_gitweb {
       $action->();
     };
     $capture->stop();
-    
+
     use Data::Dumper;
     die Dumper($@)
       if $@;
-  
+
     my $output = join '', $capture->read;
     $c->stash->{gitweb_output} = $output;
     $c->stash->{template} = 'gitweb.tt2';
@@ -60,7 +60,7 @@ sub run_gitweb {
 sub _get_commit {
   my($self, $c, $haveh) = @_;
 
-  my $h = $haveh || $c->req->param('h');
+  my $h = $haveh || $c->req->param('h') || '';
   my $f = $c->req->param('f');
   my $m = $c->model('Git');
 
@@ -71,7 +71,7 @@ sub _get_commit {
           # XXX This could definitely use more context.
           || Carp::croak("Couldn't find a hash for the commit object!");
 
-    
+
   (my $pd = $m->project_dir( $m->project )) =~ s{/\.git$}();
   my $commit = $m->get_object($hash)
     or Carp::croak("Couldn't find a commit object for '$hash' in '$pd'!");