jenkinsci / jenkinsci/git-plugin

[JENKINS-30339] Expand variables in Freestyle job 'local subdirectory' field

Open
#2,727 0 comments 0 reactions 0 assignees View on GitHub
component:git-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

I wanted to see where, when and how I could make use of GIT_BRANCH in a job that tracks multiple branches. Branch specifier is set to 'origin/topic/*', which matches two branches - 'parallel_1' and 'parallel_2'. In the additional behaviors section, I specified '${GIT_BRANCH}' as local subdirectory for repo.

I start the job manually and it triggers two builds - one for each matching branch. However, my workspace contains two directories called '${GIT_BRANCH}' (from build #1 for parallel_1 branch) and 'parallel_1' (from build #2 for parallel_2 branch).

I would expect GIT_BRANCH to be used consistently - either correctly all the time or never.

---
Originally reported by tba, imported from: Expand variables in Freestyle job 'local subdirectory' field


  • status: Open
  • priority: Major
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-02

Raw content of original issue

I wanted to see where, when and how I could make use of GIT_BRANCH in a job that tracks multiple branches. Branch specifier is set to 'origin/topic/*', which matches two branches - 'parallel_1' and 'parallel_2'. In the additional behaviors section, I specified '${GIT_BRANCH}' as local subdirectory for repo.

I start the job manually and it triggers two builds - one for each matching branch. However, my workspace contains two directories called '${GIT_BRANCH}' (from build #1 for parallel_1 branch) and 'parallel_1' (from build #2 for parallel_2 branch).

I would expect GIT_BRANCH to be used consistently - either correctly all the time or never.

environment

```
Jenkins 1.609.3

GIT plugin 2.4.0

GIT client plugin 1.19.0
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.