From ee90922f3da3f67ef19853a0759c1d09860fe3b3 Mon Sep 17 00:00:00 2001 From: Gianni Chiappetta Date: Tue, 17 Mar 2009 11:26:01 -0400 Subject: [PATCH] Added support for filenames which are quoted (usually containing international/unicode characters). --- lib/git/lib.rb | 1 + lib/git/status.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 41ebc16b..8cd70f0b 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -298,6 +298,7 @@ def ls_files command_lines('ls-files', '--stage').each do |line| (info, file) = line.split("\t") (mode, sha, stage) = info.split + file = eval(file) if file =~ /^\".*\"$/ # This takes care of quoted strings returned from git hsh[file] = {:path => file, :mode_index => mode, :sha_index => sha, :stage => stage} end hsh diff --git a/lib/git/status.rb b/lib/git/status.rb index 6f728a28..f9ee508f 100644 --- a/lib/git/status.rb +++ b/lib/git/status.rb @@ -89,7 +89,7 @@ def construct_status @files[file] = {:path => file, :untracked => true} unless @files[file] || File.directory?(file) || ignore.include?(file) end end - + # find modified in tree @base.lib.diff_files.each do |path, data| @files[path] ? @files[path].merge!(data) : @files[path] = data