File tree Expand file tree Collapse file tree 1 file changed +7
-19
lines changed Expand file tree Collapse file tree 1 file changed +7
-19
lines changed Original file line number Diff line number Diff line change 22
33# Report the status of all Git repositories within a directory tree.
44
5+ require 'pty'
56require 'main'
67require 'git'
78
@@ -140,32 +141,19 @@ Main {
140141
141142 def run
142143 $params = params
143- $params[ :dir ] . values . each do |dir |
144- print 'Looking for Git repositories'
145- if dir == '.'
146- print '...'
147- else
148- print " in #{ dir } ..."
149- end
150-
151- first = true
152- seen = Set . new
144+ seen = Set . new
145+ cmd = "find -H #{ $params[ :dir ] . values * ' ' } -name .git"
153146
154- # Recursively search for .git directories, following symlinks once
155- Dir . glob File . join ( dir , '**{,/*/**}/.git' ) do |path |
156- next if seen . include? path
147+ PTY . spawn cmd do | stdin , stdout , pid |
148+ stdin . each do |path |
149+ next if seen . include? path # never process the same path twice
157150 seen << path
158151
159- if first
160- puts 'done'
161- first = false
162- end
163-
164152 begin
165153 GitUpdate . report File . dirname ( path )
166154 rescue => ex
167155 GitUpdate . top_ten ( 'FAILED' , path , [ ex . message ] + ex . backtrace ,
168- false , '#' )
156+ false , '#' )
169157 end
170158 end
171159 end
You can’t perform that action at this time.
0 commit comments