Permalink
Browse files

Decode escaped characters in the file list parser.

These appear when file names contain non-ASCII characters or special characters like quotes or backslashes.

Affected commands are Status and Commit.

Ideally the bundle should use plumbing commands (like ‘ls-files’ with ‘-z’) but that seems to be quite a large undertaking.
  • Loading branch information...
1 parent 58e7d74 commit ddb634dc483cfdc8a117a511abbbcb359fd4d665 @sorbits sorbits committed with jcf Apr 17, 2010
Showing with 1 addition and 0 deletions.
  1. +1 −0 Support/lib/parsers.rb
View
1 Support/lib/parsers.rb 100644 → 100755
@@ -50,6 +50,7 @@ def parse_status_hash(input)
else
"?"
end
+ filename = $1.gsub(/(\\\d{3})+/) { $&.scan(/\d{3}/).map { |str| str.oct }.pack("c*") } if filename =~ /^"(.*)"$/
file_statuses[filename] ||= status
end

0 comments on commit ddb634d

Please sign in to comment.