PR #3899: Warning for RelativeTargetDirectory in Pipeline jobs

I’ve submitted PR #3899 to address issue #3068 in the git-plugin.

When “Check out to a sub-directory” is configured in a Pipeline job, the repository content is placed correctly, but the Pipeline engine still evaluates the Jenkinsfile relative to the workspace root. This mismatch can lead to confusing failures for users.

This PR introduces a warning in RelativeTargetDirectory when it is invoked within a WorkflowJob context. The goal is to make the limitation explicit and guide users toward the supported alternative (dir step).

I verified the behavior locally using mvn hpi:run with both the original and modified implementations. The warning appears consistently when expected.

PR: Warn when 'Check out to a sub-directory' is used with Pipeline jobs (fixes #3068) by Nimbusprogrammer · Pull Request #3899 · jenkinsci/git-plugin · GitHub
Issue: [JENKINS-43052] Warn if "Additional Behaviors > Check out to a sub-directory" is used in a Pipeline project · Issue #3068 · jenkinsci/git-plugin · GitHub

Feedback is appreciated.