Showing 5 changed files with 9 additions and 9 deletions
+8 -7
lib/Gitprep/Manager.pm
... ...
@@ -18,16 +18,16 @@ has 'authorized_keys_file';
18 18
 has '_tmp_branch' => '__gitprep_tmp_branch__';
19 19
 
20 20
 sub prepare_merge {
21
-  my ($self, $work_rep_info, $rep_info1, $base_branch, $rep_info2, $target_branch) = @_;
21
+  my ($self, $work_rep_info, $base_rep_info, $base_branch, $target_rep_info, $target_branch) = @_;
22 22
   
23 23
   # Fetch base repository
24
-  my $base_user_id = $rep_info1->{user};
24
+  my $base_user_id = $base_rep_info->{user};
25 25
   my @git_fetch_base_cmd = $self->app->git->cmd($work_rep_info, 'fetch', 'origin');
26 26
   Gitprep::Util::run_command(@git_fetch_base_cmd)
27 27
     or Carp::croak "Can't execute git fetch: @git_fetch_base_cmd";
28 28
   
29 29
   # Fetch target repository
30
-  my @git_fetch_target_cmd = $self->app->git->cmd($work_rep_info, 'fetch', $rep_info2->{git_dir});
30
+  my @git_fetch_target_cmd = $self->app->git->cmd($work_rep_info, 'fetch', $target_rep_info->{git_dir});
31 31
   Gitprep::Util::run_command(@git_fetch_target_cmd)
32 32
     or Carp::croak "Can't execute git fetch: @git_fetch_target_cmd";
33 33
 
... ...
@@ -89,23 +89,24 @@ sub prepare_merge {
89 89
     or Carp::croak "Can't execute git checkout: @git_checkout_tmp_branch";
90 90
   
91 91
   # git reset --hard 
92
+  my $base_object_id = $self->app->git->ref_to_object_id($base_rep_info, $base_branch);
92 93
   my @git_reset_hard_base_cmd = $self->app->git->cmd(
93 94
     $work_rep_info,
94 95
     'reset',
95 96
     '--hard',
96
-    "origin/$base_branch"
97
+    $base_object_id
97 98
   );
98 99
   Gitprep::Util::run_command(@git_reset_hard_base_cmd)
99 100
     or Carp::croak "Can't execute git reset --hard: @git_reset_hard_base_cmd";
100 101
 }
101 102
 
102 103
 sub merge {
103
-  my ($self, $work_rep_info, $rep_info1, $base_branch, $rep_info2, $target_branch) = @_;
104
+  my ($self, $work_rep_info, $base_rep_info, $base_branch, $target_rep_info, $target_branch) = @_;
104 105
   
105
-  my $object_id = $self->app->git->ref_to_object_id($rep_info2, $target_branch);
106
+  my $object_id = $self->app->git->ref_to_object_id($target_rep_info, $target_branch);
106 107
   
107 108
   # Merge
108
-  my $target_user_id = $rep_info2->{user};
109
+  my $target_user_id = $target_rep_info->{user};
109 110
   my @git_merge_cmd = $self->app->git->cmd(
110 111
     $work_rep_info,
111 112
     'merge',
-1
xt/basic.t
... ...
@@ -403,7 +403,6 @@ note 'Branches';
403 403
   # Page access
404 404
   $t->get_ok("/$user/$project/branches");
405 405
   $t->content_like(qr/Branches/);
406
-  
407 406
 }
408 407
 
409 408
 note 'Compare';
BIN
xt/basic/gitprep.db
Binary file not shown.
+1
xt/basic/work/kimoto/gitprep_t
... ...
@@ -0,0 +1 @@
1
+Subproject commit 79b1363f003d2e074ab59e82e39a34bfdb7fbeb1
-1
xt/user.t
... ...
@@ -317,7 +317,6 @@ note 'Profile';
317 317
     $t->post_ok('/_login?op=login', form => {id => 'kimoto1', password => 'a'});
318 318
     
319 319
     # Create repository
320
-    $main::x = 1;
321 320
     $t->post_ok('/_new?op=create', form => {project => 't1', description => 'Hello'});
322 321
     $t->content_like(qr/Create a new repository on the command line/);
323 322
     $t->content_like(qr/t1\.git/);