Repository: ruby-git/ruby-git (Ruby)

Issue:
`Git.deprecation` is not available but being used on `is_local_branch?`
# What happened

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

https://github.com/ruby-git/ruby-git/blob/4a7700dc088f0c85747f6010d415a7952ce44c1e/lib/git/base.rb#L288-L291


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


```shell
/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:

https://github.com/ruby-git/ruby-git/blob/4a7700dc088f0c85747f6010d415a7952ce44c1e/lib/git.rb#L7

Please guide me on:
1. if this is intended, and I forgot to bump something
1. 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`)


Discussion: Thank you for the report @carlos-santos-anchor 

This issue should be fixed in git-4.0.6. Give it a try and let me know if it fixes your problem.
> Thank you for the report @carlos-santos-anchor 
> 
> This issue should be fixed in git-4.0.6. Give it a try and let me know if it fixes your problem.

Thank you so much. 



Fix (patch):
diff --git a/lib/git/base.rb b/lib/git/base.rb
index b291c83f..b2f433c4 100644
--- a/lib/git/base.rb
+++ b/lib/git/base.rb
@@ -286,7 +286,10 @@ def local_branch?(branch)
     end
 
     def is_local_branch?(branch) # rubocop:disable Naming/PredicatePrefix
-      Git.deprecation('Git::Base#is_local_branch? is deprecated. Use Git::Base#local_branch? instead.')
+      Git::Deprecation.warn(
+        'Git::Base#is_local_branch? is deprecated and will be removed in a future version. ' \
+        'Use Git::Base#local_branch? instead.'
+      )
       local_branch?(branch)
     end
 
@@ -297,7 +300,10 @@ def remote_branch?(branch)
     end
 
     def is_remote_branch?(branch) # rubocop:disable Naming/PredicatePrefix
-      Git.deprecated('Git::Base#is_remote_branch? is deprecated. Use Git::Base#remote_branch? instead.')
+      Git::Deprecation.warn(
+        'Git::Base#is_remote_branch? is deprecated and will be removed in a future version. ' \
+        'Use Git::Base#remote_branch? instead.'
+      )
       remote_branch?(branch)
     end
 
@@ -308,7 +314,10 @@ def branch?(branch)
     end
 
     def is_branch?(branch) # rubocop:disable Naming/PredicatePrefix
-      Git.deprecated('Git::Base#is_branch? is deprecated. Use Git::Base#branch? instead.')
+      Git::Deprecation.warn(
+        'Git::Base#is_branch? is deprecated and will be removed in a future version. ' \
+        'Use Git::Base#branch? instead.'
+      )
       branch?(branch)
     end
 
diff --git a/lib/git/object.rb b/lib/git/object.rb
index d4cc06ce..ff2b113f 100644
--- a/lib/git/object.rb
+++ b/lib/git/object.rb
@@ -213,7 +213,10 @@ def diff_parent
       end
 
       def set_commit(data) # rubocop:disable Naming/AccessorMethodName
-        Git.deprecation('Git::Object::Commit#set_commit is deprecated. Use #from_data instead.')
+        Git::Deprecation.warn(
+          'Git::Object::Commit#set_commit is deprecated and will be removed in a future version. ' \
+          'Use #from_data instead.'
+        )
         from_data(data)
       end