]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Always set 'from_file' and 'to_file' in parse_difftree_raw_line
authorJakub Narebski <redacted>
Thu, 1 Nov 2007 11:38:08 +0000 (12:38 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:12 +0000 (00:07 -0400)
Always set 'from_file' and 'to_file' keys when parsing raw diff output
format line, even if filename didn't change (file was not renamed).
This allows for simpler code.

Previously, you would have written:

  $diffinfo->{'from_file'} || $diffinfo->{'file'}

but now you can just use

  $diffinfo->{'from_file'}

as 'from_file' is always defined.

While at it, replace (for merge commits)

  $diffinfo->{'from_file'}[$i] || $diffinfo->{'to_file'}

by

  defined $diffinfo->{'from_file'}[$i] ?
          $diffinfo->{'from_file'}[$i] :
          $diffinfo->{'to_file'};

to have no problems with file named '0'.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>

No differences found
This page took 0.185427 seconds and 4 git commands to generate.