Skip to content

Git.deprecation is not available but being used on is_local_branch? #842

@carlos-santos-anchor

Description

@carlos-santos-anchor

What happened

I am not sure if I am not seeing this clear, but I've hit a deprecation warning for is_local_branch?:

ruby-git/lib/git/base.rb

Lines 288 to 291 in 4a7700d

def is_local_branch?(branch) # rubocop:disable Naming/PredicatePrefix
Git.deprecation('Git::Base#is_local_branch? is deprecated. Use Git::Base#local_branch? instead.')
local_branch?(branch)
end

That is perfectly fine, and I will use the new method, what worries me is that this is triggering an error, not a warning:

/home/runner/work/path/bundle/ruby/3.3.0/gems/git-4.0.5/lib/git/base.rb:289:in `is_local_branch?': [!] undefined method `deprecation' for module Git (NoMethodError)

      Git.deprecation('Git::Base#is_local_branch? is deprecated. Use Git::Base#local_branch? instead.')
         ^^^^^^^^^^^^
Did you mean?  deprecate

And it looks like this Git.deprecation is not available for my 4.0.5 version 🤔

I am seeing this change:

Deprecation = ActiveSupport::Deprecation.new('5.0.0', 'Git')

Please guide me on:

  1. if this is intended, and I forgot to bump something
  2. Or this warning was not intended to use Git.deprecation but instead Git::Deprecation.warn().

Important

This is running on GitHub Actions (ubuntu-24.04)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions