Skip to content

Commit

Permalink
Status no longer includes ignored files.
Browse files Browse the repository at this point in the history
  • Loading branch information
gf3 committed Mar 12, 2009
1 parent 076df64 commit 96bf1ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/git/lib.rb
Expand Up @@ -304,6 +304,11 @@ def ls_files
end


def ignored_files
command_lines('ls-files', ['--others', '-i', '--exclude-standard'])
end


def config_remote(name)
hsh = {}
config_list.each do |key, value|
Expand Down
3 changes: 2 additions & 1 deletion lib/git/status.rb
Expand Up @@ -81,11 +81,12 @@ def blob(type = :index)

def construct_status
@files = @base.lib.ls_files
ignore = @base.lib.ignored_files

# find untracked in working dir
Dir.chdir(@base.dir.path) do
Dir.glob('**/*') do |file|
@files[file] = {:path => file, :untracked => true} unless @files[file] || File.directory?(file)
@files[file] = {:path => file, :untracked => true} unless @files[file] || File.directory?(file) || ignore.include?(file)
end
end

Expand Down

0 comments on commit 96bf1ac

Please sign in to comment.