Created
April 18, 2017 14:46
-
-
Save alyssais/b1990f3ccc62c2c40fac08e34c3bd0ab to your computer and use it in GitHub Desktop.
Investigating a potential memory leak in the Rugged gem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rugged" | |
def diff_parents(commit) | |
puts commit.oid | |
commit.parents.each { |parent| parent.diff(commit) } | |
commit.parents.each { |parent| diff_parents(parent) } | |
rescue SystemStackError | |
end | |
path = "#{__dir__}/rails" | |
if File.directory?(path) | |
repo = Rugged::Repository.new(path) | |
else | |
print "Cloning rails…" | |
repo = Rugged::Repository.clone_at("https://github.com/rails/rails", path) | |
puts " done" | |
end | |
diff_parents repo.head.target | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment