Skip to content

Deprecate getOldGitExe() method#3936

Merged
MarkEWaite merged 4 commits intojenkinsci:masterfrom
meetgoti07:remove_dead_codeblock
Mar 21, 2026
Merged

Deprecate getOldGitExe() method#3936
MarkEWaite merged 4 commits intojenkinsci:masterfrom
meetgoti07:remove_dead_codeblock

Conversation

@meetgoti07
Copy link
Contributor

@meetgoti07 meetgoti07 commented Mar 15, 2026

Remove dead code: DescriptorImpl.getOldGitExe() always returns null, so the if (desc.getOldGitExe() != null) block in onLoaded() never runs. This removes that block, the unused getOldGitExe() method (and its Javadoc), and the now-unused desc variable so onLoaded() is an empty initializer.

Testing done

Refactor/cleanup only: no behavior change. The removed code was unreachable because getOldGitExe() always returns null. Ran the existing test suite (e.g. mvn test) to confirm nothing regresses. No new tests added for removal of dead code.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@meetgoti07
Copy link
Contributor Author

@MarkEWaite
Since onLoaded()method is empty. Is it safe to remove it totally?

@MarkEWaite MarkEWaite added the chore Reduces maintenance effort by changes not directly visible to users label Mar 15, 2026
@MarkEWaite
Copy link
Contributor

@MarkEWaite Since onLoaded()method is empty. Is it safe to remove it totally?

I think that it is safe to remove it totally.

@meetgoti07
Copy link
Contributor Author

@MarkEWaite I have totally removed the onLoaded method

Preserve API compatibility for consumers.  Low risk to delete it, but
it is simpler for maintainers if we retain the method rather than answer
later questions about its removal.
@MarkEWaite MarkEWaite enabled auto-merge (squash) March 21, 2026 12:43
@MarkEWaite MarkEWaite changed the title Remove dead getOldGitExe() code Deprecate getOldGitExe() method Mar 21, 2026
@MarkEWaite MarkEWaite merged commit a43688b into jenkinsci:master Mar 21, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Reduces maintenance effort by changes not directly visible to users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants