Project

General

Profile

[PATCH] Show right filename for deleted file in diff ยป change_diff_deleted_filename.patch

Stone Wang, 2012-05-15 09:16

View differences:

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
    (1-1/1)