Skip to content

Commit

Permalink
gitweb: Add 'status_str' to parse_difftree_raw_line output
Browse files Browse the repository at this point in the history
Add 'status_str' to diffinfo output, which stores status (also for
merge commit) as a string.  This allows for easy checking if there is
given status among all for merge commit, e.g.
  $diffinfo->{'status_str'} =~ /D/;

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jakub Narebski authored and Junio C Hamano committed Nov 2, 2007
1 parent 9d30145 commit 6aa6f92
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -1990,7 +1990,7 @@ sub parse_difftree_raw_line {
$res{'to_mode'} = $2;
$res{'from_id'} = $3;
$res{'to_id'} = $4;
$res{'status'} = $5;
$res{'status'} = $res{'status_str'} = $5;
$res{'similarity'} = $6;
if ($res{'status'} eq 'R' || $res{'status'} eq 'C') { # renamed or copied
($res{'from_file'}, $res{'to_file'}) = map { unquote($_) } split("\t", $7);
Expand All @@ -2006,6 +2006,7 @@ sub parse_difftree_raw_line {
$res{'to_mode'} = pop @{$res{'from_mode'}};
$res{'from_id'} = [ split(' ', $3) ];
$res{'to_id'} = pop @{$res{'from_id'}};
$res{'status_str'} = $4;
$res{'status'} = [ split('', $4) ];
$res{'to_file'} = unquote($5);
}
Expand Down Expand Up @@ -2821,7 +2822,7 @@ sub fill_from_file_info {
sub is_deleted {
my $diffinfo = shift;

return $diffinfo->{'to_id'} eq ('0' x 40);
return $diffinfo->{'status_str'} =~ /D/;
}

# does patch correspond to [previous] difftree raw line
Expand Down

0 comments on commit 6aa6f92

Please sign in to comment.