Skip to content

Commit 0ce5291

Browse files
committed
git-all: another globbing/symlink fix
1 parent 3257880 commit 0ce5291

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

git-all

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,7 @@ module GitUpdate
114114
end
115115

116116
if not $params[:fetchonly].value
117-
g.branches.local.each do |branch|
118-
push_or_pull g, working_dir, branch
119-
end
120-
117+
g.branches.local.each { |b| push_or_pull g, working_dir, b }
121118
status working_dir
122119
end
123120
end
@@ -152,8 +149,13 @@ Main {
152149
end
153150

154151
first = true
152+
seen = Set.new
153+
155154
# Recursively search for .git directories, following symlinks once
156-
Dir.glob File.join(dir, '**', '*', '**', '.git') do |path|
155+
Dir.glob File.join(dir, '**{,/*/**}/.git') do |path|
156+
next if seen.include? path
157+
seen << path
158+
157159
if first
158160
puts 'done'
159161
first = false

0 commit comments

Comments
 (0)