blackwinter-git 1.2.6 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/git/lib.rb +8 -0
  2. data/lib/git/status.rb +2 -3
  3. metadata +3 -3
data/lib/git/lib.rb CHANGED
@@ -334,6 +334,14 @@ module Git
334
334
  command_lines('ls-files', ['--others', '-i', '--exclude-standard'])
335
335
  end
336
336
 
337
+ def untracked_files(path_limiter = nil)
338
+ arr_opts = ['--short', '--untracked=all']
339
+ arr_opts << '--' << path_limiter if path_limiter.is_a? String
340
+
341
+ command_lines('status', arr_opts).map { |line|
342
+ line.sub!(/\A\?\?\s/, '')
343
+ }.compact
344
+ end
337
345
 
338
346
  def config_remote(name)
339
347
  hsh = {}
data/lib/git/status.rb CHANGED
@@ -81,12 +81,11 @@ module Git
81
81
 
82
82
  def construct_status
83
83
  @files = @base.lib.ls_files
84
- ignore = @base.lib.ignored_files
85
84
 
86
85
  # find untracked in working dir
87
86
  Dir.chdir(@base.dir.path) do
88
- Dir.glob('**/*') do |file|
89
- @files[file] = {:path => file, :untracked => true} unless @files[file] || File.directory?(file) || ignore.include?(file)
87
+ @base.lib.untracked_files.each do |file|
88
+ @files[file] = {:path => file, :untracked => true} unless @files[file] || File.directory?(file)
90
89
  end
91
90
  end
92
91
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blackwinter-git
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 6
10
- version: 1.2.6
9
+ - 7
10
+ version: 1.2.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Scott Chacon