Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump libgit2 to v0.28.2 and backport some fixes #804

Merged
merged 4 commits into from Jun 18, 2019

Commits on Jun 18, 2019

  1. repo: catch exceptions when iterating through status

    When we call the block, an exception or even a call to `break` would cause us to
    unwind the stack and skip any resource freeing that we may have. The solution is
    to call `rb_protect` which will let us catch the exception and raise whenever we
    need to.
    
    Doing this as part of a `git_status_foreach` is unnecessarily awkward so move to
    iterating over the status list ourselves and free the entry list as soon as we
    notice there was an exception.
    
    For example, this program will consume memory
    indefinitely:
    
        require 'rugged'
    
        repo = Rugged::Repository.new ARGV[0]
        loop do
          repo.status do |file, status_data|
            break
          end
        end
    
    Thanks to Aaron Patterson for discovering this and the original hacky fix.
    carlosmn committed Jun 18, 2019
    Configuration menu
    Copy the full SHA
    c757f17 View commit details
    Browse the repository at this point in the history
  2. config: catch exceptions during iteration

    Not doing so means an exception or even a break will jump over us and not give
    us the opportunity to free the resources we've allocated.
    carlosmn committed Jun 18, 2019
    Configuration menu
    Copy the full SHA
    2625ba2 View commit details
    Browse the repository at this point in the history
  3. Unlock GVL callback should be void *(*)(void *)

    I use strict compiler flags on my version of Ruby.  Since the callback
    signature didn't match correctly, compilation would fail.  This fixes
    the nogvl callback signature.
    tenderlove authored and carlosmn committed Jun 18, 2019
    Configuration menu
    Copy the full SHA
    83b3bbd View commit details
    Browse the repository at this point in the history
  4. Bump libgit2 to v0.28.2

    carlosmn committed Jun 18, 2019
    Configuration menu
    Copy the full SHA
    8d3fa08 View commit details
    Browse the repository at this point in the history