Commit 3c045c90765d79dce64d829837b719f16f4af2ab

Grit::Git: Allow to use pipe (|), and do not use empty/nil arguments

Commit diff

lib/grit/git.rb

 
3131 # Returns String
3232 def method_missing(cmd, options = {}, *args)
3333 opt_args = transform_options(options)
34 ext_args = args.map { |a| a == '--' ? a : "'#{e(a)}'" }
34 ext_args = args.map { |a| if not a.to_s.empty? then (a == '--' or a =~ /^\s*\|/) ? a : "'#{shell_escape(a)}'" end }
3535
3636 call = "#{Git.git_binary} --git-dir='#{self.git_dir}' #{cmd.to_s.gsub(/_/, '-')} #{(opt_args + ext_args).join(' ')}"
3737 puts call if Grit.debug
toggle raw diff