diff options
author | Jakub Narebski <jnareb@gmail.com> | 2007-11-01 12:38:09 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-11-01 17:34:50 -0700 |
commit | 6aa6f92fda47cc4ee5f599895e8a5a327fb6f9ab (patch) | |
tree | 3b217b024ae019e91bcaaeff601c72e4a7b843fa /gitweb | |
parent | 9d3014566302ad0d3d378b0a1653959b3118066d (diff) | |
download | git-6aa6f92fda47cc4ee5f599895e8a5a327fb6f9ab.tar.gz git-6aa6f92fda47cc4ee5f599895e8a5a327fb6f9ab.tar.xz |
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>
Diffstat (limited to 'gitweb')
-rwxr-xr-x | gitweb/gitweb.perl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index b22f4be15..abb5a7d39 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -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); @@ -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); } @@ -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 |