git-plugin icon indicating copy to clipboard operation
git-plugin copied to clipboard

[JENKINS-70463] Lightweight checkout: commitId as branch name does not work when expanded

Open jenkins-infra-bot opened this issue 2 years ago • 0 comments

The Git plugin should now be able to expand environment variables and use them for the checkouts, such as the branch specifier. This works completely fine when specifying a branch name. It also worked fine when entering a commit ID manually. 

However, it fails when I combine the two and add the commit ID as a parameter, which is then used for the branch (see attached screenshot). The plugin will treat it as a regular branch name and fails to do the checkout.

stderr: fatal: couldn't find remote ref refs/heads/62f7ad718b0d427b7fd0cb0fe15a615308c41d92
My workaround for now is to use the branch name instead of the commit hash.


Originally reported by vogtmh, imported from: Lightweight checkout: commitId as branch name does not work when expanded
  • status: Open
  • priority: Minor
  • component(s): git-plugin
  • label(s): pipeline
  • resolution: Unresolved
  • votes: 0
  • watchers: 3
  • imported: 2025-12-02
Raw content of original issue

The Git plugin should now be able to expand environment variables and use them for the checkouts, such as the branch specifier. This works completely fine when specifying a branch name. It also worked fine when entering a commit ID manually. 

However, it fails when I combine the two and add the commit ID as a parameter, which is then used for the branch (see attached screenshot). The plugin will treat it as a regular branch name and fails to do the checkout.

stderr: fatal: couldn't find remote ref refs/heads/62f7ad718b0d427b7fd0cb0fe15a615308c41d92 My workaround for now is to use the branch name instead of the commit hash.

  • environment: Jenkins 2.375.2, Git Plugin 5.0.0
1 attachment

jenkins-infra-bot avatar Jan 20 '23 23:01 jenkins-infra-bot