Skip to content

Removed all Dir.chdir calls from private use #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
Closed
Prev Previous commit
Next Next commit
Removed Dir.chdir from construct_status
  • Loading branch information
mbishop-fiksu committed Dec 1, 2014
commit 9683a3281fa3ebac9230f1004a7f21b38b903cc8
10 changes: 5 additions & 5 deletions lib/git/status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ def construct_status
ignore = @base.lib.ignored_files

# find untracked in working dir
Dir.chdir(@base.dir.path) do
Dir.glob('**/*', File::FNM_DOTMATCH) do |file|
next if @files[file] || File.directory?(file) || ignore.include?(file) || file =~ /^.git\/.+/
prefix = "#{@base.dir.path}/"
Dir.glob(prefix+"**/*", File::FNM_DOTMATCH) do |abs_file|
file = abs_file.byteslice(prefix.length..-1)
next if @files[file] || File.directory?(file) || ignore.include?(file) || file =~ /^.git\/.+/

@files[file] = {:path => file, :untracked => true}
end
@files[file] = {:path => file, :untracked => true}
end

# find modified in tree
Expand Down