Showing 7 changed files with 13 additions and 13 deletions
+5 -5
lib/Gitprep/Git.pm
... ...
@@ -98,10 +98,10 @@ sub no_merged_branch_h {
98 98
 }
99 99
 
100 100
 sub branches {
101
-  my ($self, $user, $project) = @_;
101
+  my ($self, %opt) = @_;
102 102
   
103 103
   # Branches
104
-  my @cmd = $self->cmd_rep($user, $project, 'branch');
104
+  my @cmd = $self->cmd(%opt, command => ['branch']);
105 105
   open my $fh, '-|', @cmd or return;
106 106
   my $branches = [];
107 107
   my $start;
... ...
@@ -114,11 +114,11 @@ sub branches {
114 114
     $branch_name =~ s/\s*$//;
115 115
     
116 116
     # No merged branch
117
-    $no_merged_branches_h = $self->no_merged_branch_h(%{$self->app->rep_info($user, $project)})
117
+    $no_merged_branches_h = $self->no_merged_branch_h(%opt)
118 118
       unless $start++;
119 119
     
120 120
     # Branch
121
-    my $branch = $self->branch(%{$self->app->rep_info($user, $project)}, name => $branch_name);
121
+    my $branch = $self->branch(%opt, name => $branch_name);
122 122
     $branch->{no_merged} = 1 if $no_merged_branches_h->{$branch_name};
123 123
     push @$branches, $branch;
124 124
   }
... ...
@@ -603,7 +603,7 @@ sub exists_branch {
603 603
 sub delete_branch {
604 604
   my ($self, $user, $project, $branch) = @_;
605 605
   
606
-  my $branches = $self->branches($user, $project);
606
+  my $branches = $self->branches(%{$self->app->rep_info($user, $project)});
607 607
   my $exists;
608 608
   for my $b (@$branches) {
609 609
     if ($branch eq $b->{name}) {
+1 -1
templates/api/revs.html.ep
... ...
@@ -5,7 +5,7 @@
5 5
   my $git = app->git;
6 6
   
7 7
   # Branches
8
-  my $branches = $git->branches($user, $project) || [];
8
+  my $branches = $git->branches(%{$self->app->rep_info($user, $project)}) || [];
9 9
   my @branch_names = map { $_->{name} } @$branches;
10 10
   
11 11
   # Tags
+1 -1
templates/auto/_search.html.ep
... ...
@@ -113,7 +113,7 @@
113 113
                   my $project = $project->{name};
114 114
                   my $rev = app->manager->default_branch($user, $project);
115 115
                   my $desc = app->git->description($user, $project);
116
-                  my $branches = app->git->branches($user, $project);
116
+                  my $branches = app->git->branches(%{$self->app->rep_info($user, $project)});
117 117
                   my $commit;
118 118
                   if (@$branches) {
119 119
                     $commit = app->git->get_commit($user, $project, $rev);
+1 -1
templates/branches.html.ep
... ...
@@ -70,7 +70,7 @@
70 70
   my $page_count = 20;
71 71
   my $skip = $page_count * ($page - 1);
72 72
   
73
-  my $branches = $git->branches($user, $project);
73
+  my $branches = $git->branches(%{$self->app->rep_info($user, $project)});
74 74
   my $max = 0;
75 75
   my $active_count = 0;
76 76
   my $stale_count = 0;
+2 -2
templates/import-branch.html.ep
... ...
@@ -16,7 +16,7 @@
16 16
   
17 17
   # Branches
18 18
   my $git = app->git;
19
-  my $remote_branches = $git->branches($remote_user, $remote_project);
19
+  my $remote_branches = $git->branches(%{$self->app->rep_info($remote_user, $remote_project)});
20 20
   my $remote_branch_names = [map { $_->{name} } @$remote_branches];
21 21
   
22 22
   my $op = param('op') || '';
... ...
@@ -73,7 +73,7 @@
73 73
     if ($validation->is_valid) {
74 74
       
75 75
       # Check branch name
76
-      my $branches = $git->branches($user, $project);
76
+      my $branches = $git->branches(%{$self->app->rep_info($user, $project)});
77 77
       
78 78
       if (!$force && grep { $branch eq $_->{name} } @$branches) {
79 79
         $errors = ["Branch \"$branch\" is already exists. If you want to import this branch, check force option."];
+2 -2
templates/network.html.ep
... ...
@@ -3,7 +3,7 @@
3 3
   my $api = gitprep_api;
4 4
   
5 5
   # Branches
6
-  my $branches = [map { $_->{name} } @{app->git->branches($user, $project)}];
6
+  my $branches = [map { $_->{name} } @{app->git->branches(%{$self->app->rep_info($user, $project)})}];
7 7
   
8 8
   # Members
9 9
   my $members = app->manager->members($user, $project);
... ...
@@ -11,7 +11,7 @@
11 11
   # Members branches
12 12
   for my $member (@$members) {
13 13
     my $branches = [
14
-      map { $_->{name} } @{app->git->branches($member->{id}, $member->{project})}
14
+      map { $_->{name} } @{app->git->branches(%{$self->app->rep_info($member->{id}, $member->{project})})}
15 15
     ];
16 16
     $member->{branches} = $branches;
17 17
   }
+1 -1
templates/settings.html.ep
... ...
@@ -229,7 +229,7 @@
229 229
             <li id="default-branch">
230 230
               Default Branch
231 231
               <%
232
-                my $branches = $git->branches($user, $project);
232
+                my $branches = $git->branches(%{$self->app->rep_info($user, $project)});
233 233
                 my $branch_names = [map { $_->{name} } @$branches];
234 234
                 my $default_branch = app->manager->default_branch($user, $project);
235 235
                 push @$branch_names, $default_branch unless @$branch_names;