Skip to content

Conversation

@jcouball
Copy link
Member

@jcouball jcouball commented Nov 11, 2025

This PR fixes #842 by replacing incorrect calls to nonexistent methods (Git.deprecation/Git.deprecated) with the correct Git::Deprecation.warn API.

Root Cause

Issue #842 reported that deprecated methods were calling Git.deprecation which doesn't exist, causing NoMethodError instead of deprecation warnings.

Changes Made

Fixed Deprecation Warnings

  • Git::Base: Updated is_local_branch?, is_remote_branch?, is_branch? to use Git::Deprecation.warn
  • Git::Base: Fixed deprecation warnings for set_index and set_working check argument
  • Git::Object::Commit: Updated set_commit to use Git::Deprecation.warn

Test Improvements

  • Consolidated all deprecation tests into tests/units/test_deprecations.rb
  • Added comprehensive test coverage for all deprecated methods:
    • Git::Base deprecated predicates and arguments
    • Git::Log deprecated enumerable methods
    • Git::Object deprecated factory patterns
    • Git::Lib::warn_if_old_command
  • Removed redundant test files (test_log_deprecations.rb, test_base_deprecations.rb)

Closes #842

@jcouball jcouball force-pushed the fix/842-deprecation-warn branch 2 times, most recently from 6bfd78e to 160f786 Compare November 11, 2025 19:25
Replace invalid Git.deprecation/Git.deprecated calls with Git::Deprecation.warn.
Consolidate all deprecation-related tests into tests/units/test_deprecations.rb.

Changes:
- Base: use Git::Deprecation.warn in is_* methods and set_index/set_working
- Object::Commit#set_commit warns properly
- Consolidated log/base/object deprecation tests into one file
- Removed redundant test files

All tests pass locally: 430 tests, 1582 assertions.
@jcouball jcouball force-pushed the fix/842-deprecation-warn branch from 160f786 to 22055b5 Compare November 11, 2025 19:35
@jcouball jcouball merged commit a731110 into main Nov 11, 2025
12 of 13 checks passed
@jcouball jcouball deleted the fix/842-deprecation-warn branch November 11, 2025 19:48
Copy link

@carlos-santos-anchor carlos-santos-anchor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants