I believe you can find all .git folders using Dir.glob, and then you can just iterate over the matches, obviating the need for a recursive helper.