Showing 6 changed files with 18 additions and 13 deletions
+4 -2
lib/Gitprep/Git.pm
... ...
@@ -153,9 +153,11 @@ sub cmd_rep {
153 153
   my ($self, $user, $project, @cmd) = @_;
154 154
   
155 155
   # Git command
156
-  my $rep_info = $self->app->rep_path($user, $project);
156
+  my $rep_info = $self->app->rep_info($user, $project);
157 157
   
158
-  return $self->cmd_dir($rep_info, @cmd);
158
+  my $rep_git_dir = $rep_info->{git_dir};
159
+  
160
+  return $self->cmd_dir($rep_git_dir, @cmd);
159 161
 }
160 162
 
161 163
 sub cmd_dir {
+1 -1
lib/Gitprep/Manager.pm
... ...
@@ -15,7 +15,7 @@ use Gitprep::Util;
15 15
 has 'app';
16 16
 has 'authorized_keys_file';
17 17
 
18
-sub create_rep_work {
18
+sub create_work_rep {
19 19
   my ($self, $user, $project) = @_;
20 20
   
21 21
   # Remote repository
+1 -2
templates/compare.html.ep
... ...
@@ -62,10 +62,9 @@
62 62
   if ($can_open_pull_request) {
63 63
     
64 64
     # Create working repository if it don't exist
65
-    $self->app->manager->create_rep_work($user, $project);
65
+    $self->app->manager->create_work_rep($user, $project);
66 66
     
67 67
     # Fetch repository
68
-    my $rep = $self->app->rep_path($user, $project);
69 68
     my @git_fetch_cmd = $self->app->git->cmd(app->work_rep_info($user, $project), 'fetch');
70 69
     Gitprep::Util::run_command(@git_fetch_cmd)
71 70
       or Carp::croak "Can't execute git fetch: @git_fetch_cmd";
+6 -4
templates/smart-http/info-refs.html.ep
... ...
@@ -14,8 +14,9 @@
14 14
     my $service_cmd = $service;
15 15
     substr($service_cmd, 0, 4, '');
16 16
     
17
-    my $rep = app->rep_path($user, $project);
18
-    my @cmd = $git->cmd_rep($user, $project, $service_cmd, '--stateless-rpc', '--advertise-refs', $rep);
17
+    my $rep_info = app->rep_info($user, $project);
18
+    my $rep_git_dir = $rep_info->{git_dir};
19
+    my @cmd = $git->cmd_rep($user, $project, $service_cmd, '--stateless-rpc', '--advertise-refs', $rep_git_dir);
19 20
     
20 21
     my ($cout, $cerr) = (Symbol::gensym, Symbol::gensym);
21 22
     my $pid = IPC::Open3::open3(my $cin, $cout, $cerr, @cmd );
... ...
@@ -65,8 +66,9 @@
65 66
       or die "Can't close pipe for @cmd:$!";
66 67
     
67 68
     my $content_type = 'text/plain; charset=UTF-8';
68
-    my $rep = app->rep_path($user, $project);
69
-    my $file = "$rep/info/refs";
69
+    my $rep_info = app->rep_info($user, $project);
70
+    my $rep_git_dir = $rep_info->{git_dir};
71
+    my $file = "$rep_git_dir/info/refs";
70 72
     if (-f $file) {
71 73
       my $asset = Mojo::Asset::File->new(path => $file);
72 74
       my $content = $asset->slurp;
+3 -2
templates/smart-http/service.html.ep
... ...
@@ -9,8 +9,9 @@
9 9
   
10 10
   my $git = app->git;
11 11
   
12
-  my $rep_dir = app->rep_path($user, $project);
13
-  my @cmd = $git->cmd_rep($user, $project, $service, '--stateless-rpc', $rep_dir);
12
+  my $rep_info = app->rep_info($user, $project);
13
+  my $rep_git_dir = $rep_info->{git_dir};
14
+  my @cmd = $git->cmd_rep($user, $project, $service, '--stateless-rpc', $rep_git_dir);
14 15
   
15 16
   # Command
16 17
   my ($cout, $cerr) = (Symbol::gensym, Symbol::gensym);
+3 -2
templates/smart-http/static.html.ep
... ...
@@ -31,8 +31,9 @@
31 31
     $content_type = 'application/x-git-packed-objects-toc';
32 32
   }
33 33
   
34
-  my $rep = app->rep_path($user, $project);
35
-  my $file = "$rep/$path";
34
+  my $rep_info = app->rep_info($user, $project);
35
+  my $rep_git_dir = $rep_info->{git_dir};
36
+  my $file = "$rep_git_dir/$path";
36 37
   if (-f $file) {
37 38
     my $asset = Mojo::Asset::File->new(path => $file);
38 39
     my $content = $asset->slurp;