Permalink
Browse files

run ls-files with -z to cope better with control chars and strange en…

…codings

This stops git-ls-files from escaping control characters and makes it terminate lines with \0
  • Loading branch information...
AlD authored and purcell committed Aug 8, 2008
1 parent 8f41333 commit ac644a9a2053fe89b4974bd40facdf71fbfcea34
Showing with 1 addition and 1 deletion.
  1. +1 −1 darcs-to-git
View
@@ -347,7 +347,7 @@ class DarcsPatch
end
def git_ls_files(wanted)
- output_of(*["git-ls-files", "-t", "-o", "-m", "-d", "-X", ".git/info/exclude"]).scan(/^(.?) (.*?)$/m).map do |code, name|
+ output_of(*["git-ls-files", "-t", "-o", "-m", "-d", "-z", "-X", ".git/info/exclude"]).scan(/(.?) (.*?)\0/m).map do |code, name|
name if wanted.include?(code)
end.compact
end

0 comments on commit ac644a9

Please sign in to comment.