Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/git/escaped_path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def unescape
private

def extract_octal(path, index)
[path[index + 1..index + 4].to_i(8), 4]
[path[index + 1..index + 3].to_i(8), 4]
end

def extract_escape(path, index)
Expand Down
6 changes: 6 additions & 0 deletions tests/units/test_escaped_path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ def test_unicode_path
assert_equal(expected_unescaped_path, Git::EscapedPath.new(path).unescape)
end

def test_unicode_path2
path = 'test\320\2411991923'
expected_unescaped_path = 'testС1991923'
assert_equal(expected_unescaped_path, Git::EscapedPath.new(path).unescape)
end

def test_single_char_escapes
Git::EscapedPath::UNESCAPES.each_pair do |escape_char, expected_char|
path = "\\#{escape_char}"
Expand Down