From bc60052b519b8b991e50b8ccb30f2b76ad125996 Mon Sep 17 00:00:00 2001 From: scott Chacon Date: Fri, 16 Nov 2007 13:24:30 -0800 Subject: updated the docs --- lib/git/lib.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/git/lib.rb') diff --git a/lib/git/lib.rb b/lib/git/lib.rb index dbd3d69..76223de 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -427,11 +427,11 @@ module Git end def command(cmd, opts = {}) - ENV['GIT_DIR'] = @git_dir - ENV['GIT_INDEX_FILE'] = @git_index_file - ENV['GIT_WORK_DIR'] = @git_work_dir - path = @git_work_dir || @git_dir || @path - Dir.chdir(path) do + ENV['GIT_DIR'] = @git_dir if (@git_dir != ENV['GIT_DIR']) + ENV['GIT_INDEX_FILE'] = @git_index_file if (@git_index_file != ENV['GIT_INDEX_FILE']) + ENV['GIT_WORK_DIR'] = @git_work_dir if (@git_work_dir != ENV['GIT_WORK_DIR']) + #path = @git_work_dir || @git_dir || @path + #Dir.chdir(path) do opts = opts.to_a.join(' ') git_cmd = "git #{cmd} #{opts}" out = `git #{cmd} #{opts} 2>&1`.chomp @@ -449,7 +449,7 @@ module Git raise Git::GitExecuteError.new(git_cmd + ':' + out.to_s) end out - end + #end end end -- cgit