diff options
author | Go MAEDA <maeda@farend.jp> | 2024-01-08 01:04:37 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2024-01-08 01:04:37 +0000 |
commit | 52a55f407b74815c13675f4176570b8a952d7b75 (patch) | |
tree | 0ec4550df5a3e31b70432a99b29228fb05b130e0 /lib/redmine/diff_table.rb | |
parent | 4d3fc7f89ec7f3d121b64ccb7d7b45dcf5827363 (diff) | |
download | redmine-52a55f407b74815c13675f4176570b8a952d7b75.tar.gz redmine-52a55f407b74815c13675f4176570b8a952d7b75.zip |
Replace String#sub with delete_prefix / delete_suffix (#40008).
Patch by Go MAEDA (@maeda).
git-svn-id: https://svn.redmine.org/redmine/trunk@22596 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/diff_table.rb')
-rw-r--r-- | lib/redmine/diff_table.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/redmine/diff_table.rb b/lib/redmine/diff_table.rb index 989e51c32..bd31c7cde 100644 --- a/lib/redmine/diff_table.rb +++ b/lib/redmine/diff_table.rb @@ -91,12 +91,12 @@ module Redmine if both_git_diff if file_name && arg == "/dev/null" # keep the original file name - @file_name = file_name.sub(%r{^a/}, '') + @file_name = file_name.delete_prefix('a/') else # remove leading a/ - @previous_file_name = file_name.sub(%r{^a/}, '') unless file_name == "/dev/null" + @previous_file_name = file_name.delete_prefix('a/') unless file_name == "/dev/null" # remove leading b/ - @file_name = arg.sub(%r{^b/}, '') + @file_name = arg.delete_prefix('b/') @previous_file_name = nil if @previous_file_name == @file_name end |