@matheusbsbs / matheus-bagliano / commits / 6aa6f92fda
Fork 0

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>

Jakub Narebski committed Nov 1, 2007 at 12:38 UTC 6aa6f92fda47cc4ee5f599895e8a5a327fb6f9ab
1 file changed +3 -2
gitweb/gitweb.perl
+3 -2
@@ -1990,7 +1990,7 @@ sub parse_difftree_raw_line {
1990 $res{'to_mode'} = $2;
1991 $res{'from_id'} = $3;
1992 $res{'to_id'} = $4;
1993 - $res{'status'} = $5;
1993 + $res{'status'} = $res{'status_str'} = $5;
1994 $res{'similarity'} = $6;
1995 if ($res{'status'} eq 'R' || $res{'status'} eq 'C') { # renamed or copied
1996 ($res{'from_file'}, $res{'to_file'}) = map { unquote($_) } split("\t", $7);
@@ -2006,6 +2006,7 @@ sub parse_difftree_raw_line {
2006 $res{'to_mode'} = pop @{$res{'from_mode'}};
2007 $res{'from_id'} = [ split(' ', $3) ];
2008 $res{'to_id'} = pop @{$res{'from_id'}};
2009 + $res{'status_str'} = $4;
2010 $res{'status'} = [ split('', $4) ];
2011 $res{'to_file'} = unquote($5);
2012 }
@@ -2821,7 +2822,7 @@ sub fill_from_file_info {
2822 sub is_deleted {
2823 my $diffinfo = shift;
2824
2824 - return $diffinfo->{'to_id'} eq ('0' x 40);
2825 + return $diffinfo->{'status_str'} =~ /D/;
2826 }
2827
2828 # does patch correspond to [previous] difftree raw line