... | ... |
@@ -133,7 +133,7 @@ sub branch_commits { |
133 | 133 |
my ($self, $rep, $rev1, $rev2) = @_; |
134 | 134 |
|
135 | 135 |
# Command "git diff-tree" |
136 |
- my @cmd = ($self->cmd($rep), 'show-branch', '--all', $rev1, $rev2); |
|
136 |
+ my @cmd = ($self->cmd($rep), 'show-branch', $rev1, $rev2); |
|
137 | 137 |
open my $fh, "-|", @cmd |
138 | 138 |
or croak 500, "Open git-show-branch failed"; |
139 | 139 |
|
... | ... |
@@ -145,7 +145,7 @@ sub branch_commits { |
145 | 145 |
if ($start) { |
146 | 146 |
my ($id) = $line =~ /^.*?\[(.+)?\]/; |
147 | 147 |
|
148 |
- next unless $id =~ /^\Q$rev2\E^?$/ || $id =~ /^\Q$rev2\E^[0-9]+$/; |
|
148 |
+ next unless $id =~ /^\Q$rev2\E\^?$/ || $id =~ /^\Q$rev2\E^[0-9]+$/; |
|
149 | 149 |
|
150 | 150 |
my $commit = $self->parse_commit($rep, $id); |
151 | 151 |
|
... | ... |
@@ -163,6 +163,27 @@ sub branch_commits { |
163 | 163 |
return $commits; |
164 | 164 |
} |
165 | 165 |
|
166 |
+sub separated_commit { |
|
167 |
+ my ($self, $rep, $rev1, $rev2) = @_; |
|
168 |
+ |
|
169 |
+ # Command "git diff-tree" |
|
170 |
+ my @cmd = ($self->cmd($rep), 'show-branch', $rev1, $rev2); |
|
171 |
+ open my $fh, "-|", @cmd |
|
172 |
+ or croak 500, "Open git-show-branch failed"; |
|
173 |
+ |
|
174 |
+ my $commits = []; |
|
175 |
+ my $start; |
|
176 |
+ my @lines = <$fh>; |
|
177 |
+ my $last_line = pop @lines; |
|
178 |
+ my $commit; |
|
179 |
+ if (defined $last_line) { |
|
180 |
+ my ($id) = $last_line =~ /^.*?\[(.+)?\]/; |
|
181 |
+ $commit = $self->parse_commit($rep, $id); |
|
182 |
+ } |
|
183 |
+ |
|
184 |
+ return $commit; |
|
185 |
+} |
|
186 |
+ |
|
166 | 187 |
sub commits_number { |
167 | 188 |
my ($self, $rep, $ref) = @_; |
168 | 189 |
|