[PATCH] Show right filename for deleted file in diff ยป change_diff_deleted_filename.patch
lib/redmine/unified_diff.rb | ||
---|---|---|
71 | 71 |
# Returns false when the diff ends |
72 | 72 |
def add_line(line) |
73 | 73 |
unless @parsing |
74 |
if line =~ /^(---|\+\+\+) (.*)$/
|
|
75 |
@file_name = $2 |
|
74 |
if line =~ /^(--- a\/|--- |\+\+\+ b\/|\+\+\+ )(.*)$/
|
|
75 |
@file_name = $2 if $2 != "/dev/null"
|
|
76 | 76 |
elsif line =~ /^@@ (\+|\-)(\d+)(,\d+)? (\+|\-)(\d+)(,\d+)? @@/ |
77 | 77 |
@line_num_l = $2.to_i |
78 | 78 |
@line_num_r = $5.to_i |