Skip to content

Commit 6aa6f92

Browse files
jnarebgitster
authored andcommitted
gitweb: Add 'status_str' to parse_difftree_raw_line output
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>
1 parent 9d30145 commit 6aa6f92

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gitweb/gitweb.perl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,7 +1990,7 @@ sub parse_difftree_raw_line {
19901990
$res{'to_mode'} = $2;
19911991
$res{'from_id'} = $3;
19921992
$res{'to_id'} = $4;
1993-
$res{'status'} = $5;
1993+
$res{'status'} = $res{'status_str'} = $5;
19941994
$res{'similarity'} = $6;
19951995
if ($res{'status'} eq 'R' || $res{'status'} eq 'C') { # renamed or copied
19961996
($res{'from_file'}, $res{'to_file'}) = map { unquote($_) } split("\t", $7);
@@ -2006,6 +2006,7 @@ sub parse_difftree_raw_line {
20062006
$res{'to_mode'} = pop @{$res{'from_mode'}};
20072007
$res{'from_id'} = [ split(' ', $3) ];
20082008
$res{'to_id'} = pop @{$res{'from_id'}};
2009+
$res{'status_str'} = $4;
20092010
$res{'status'} = [ split('', $4) ];
20102011
$res{'to_file'} = unquote($5);
20112012
}
@@ -2821,7 +2822,7 @@ sub fill_from_file_info {
28212822
sub is_deleted {
28222823
my $diffinfo = shift;
28232824

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

28272828
# does patch correspond to [previous] difftree raw line

0 commit comments

Comments
 (0)