Commit 9d30145
gitweb: Always set 'from_file' and 'to_file' in parse_difftree_raw_line
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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 3e4bb08 commit 9d30145
1 file changed
+10
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1995 | 1995 | | |
1996 | 1996 | | |
1997 | 1997 | | |
1998 | | - | |
| 1998 | + | |
1999 | 1999 | | |
2000 | 2000 | | |
2001 | 2001 | | |
| |||
2062 | 2062 | | |
2063 | 2063 | | |
2064 | 2064 | | |
2065 | | - | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
2066 | 2069 | | |
2067 | 2070 | | |
2068 | 2071 | | |
| |||
2074 | 2077 | | |
2075 | 2078 | | |
2076 | 2079 | | |
2077 | | - | |
| 2080 | + | |
2078 | 2081 | | |
2079 | 2082 | | |
2080 | 2083 | | |
| |||
2084 | 2087 | | |
2085 | 2088 | | |
2086 | 2089 | | |
2087 | | - | |
| 2090 | + | |
2088 | 2091 | | |
2089 | 2092 | | |
2090 | 2093 | | |
| |||
2829 | 2832 | | |
2830 | 2833 | | |
2831 | 2834 | | |
2832 | | - | |
| 2835 | + | |
2833 | 2836 | | |
2834 | 2837 | | |
2835 | 2838 | | |
| |||
4667 | 4670 | | |
4668 | 4671 | | |
4669 | 4672 | | |
4670 | | - | |
4671 | | - | |
| 4673 | + | |
| 4674 | + | |
4672 | 4675 | | |
4673 | 4676 | | |
4674 | 4677 | | |
| |||
0 commit comments