Describe your use-case which is not covered by existing documentation.
If a refspec is included in the checkout scm definition of a multibranch Pipeline using JGit for checkout and the refspec has a leading space character, the checkout fails with the JGit message
Remote does not have available for fetch.
The same refspec with leading spaces does not affect command line git checkout. It works in either case with command line git. Leading space handling by command line git is preferred rather than the way that the git client plugin honors the leading spaces and passes them to JGit.
Command line git does not see the issue because extra spaces between arguments of a command line program are generally not an issue. Lucky circumstances that allow the CLI git checkout to be better behaved than the JGit checkout.
Because command line git accepts the leading and trailing spaces, it would be safe for someone to fix this by removing leading and trailing spaces from the refspec value when it is saved and when it is used.
markewaite, imported from: JGit checkout fails if refspec has leading spaces
assignee: jagrutiti's avatarjagrutiti
status: In Review
priority: Minor
component(s): git-client-plugin
label(s): newbie-friendly
resolution: Unresolved
votes: 0
watchers: 2
imported: 20251211-071809
Raw content of original issue
git-client-plugin-git-client-3.1.0-beta.zip
Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.
No response
Are you interested in contributing to the documentation?
No response
Describe your use-case which is not covered by existing documentation.
If a refspec is included in the checkout scm definition of a multibranch Pipeline using JGit for checkout and the refspec has a leading space character, the checkout fails with the JGit message
Remote does not have available for fetch.
The same refspec with leading spaces does not affect command line git checkout. It works in either case with command line git. Leading space handling by command line git is preferred rather than the way that the git client plugin honors the leading spaces and passes them to JGit.
Command line git does not see the issue because extra spaces between arguments of a command line program are generally not an issue. Lucky circumstances that allow the CLI git checkout to be better behaved than the JGit checkout.
Because command line git accepts the leading and trailing spaces, it would be safe for someone to fix this by removing leading and trailing spaces from the refspec value when it is saved and when it is used.
markewaite, imported from: JGit checkout fails if refspec has leading spaces
assignee: jagrutiti's avatarjagrutiti
status: In Review
priority: Minor
component(s): git-client-plugin
label(s): newbie-friendly
resolution: Unresolved
votes: 0
watchers: 2
imported: 20251211-071809
Raw content of original issue
git-client-plugin-git-client-3.1.0-beta.zip
Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.
No response
Are you interested in contributing to the documentation?
No response