jenkinsci / jenkinsci/git-plugin
[JENKINS-18132] Git plugin failed to evaluate the variable's value for local repo directory when using Git hook
- Dominant language
- Java
- Stars
- 694
- Forks
- 1.1k
- Avg merge
- 1h 29m
- Merged PRs (30d)
- 3
Description
Our project is using a variable to specify the local repository directory for Git, such as "${var}". When triggering builds with Git hook, GitSCM.compareRemoteRevisionWithImpl() uses it's plain text value to retrieve the working directory, eg "workspace/${var}" instead of "workspace/dir". As a result, hook always think new change is found and trigger new builds even there is no new change at all.
I did some debugging and found that the environment variables retrieved when triggered by hooks are less than those when triggered by "Build Now". But I could come up with a quick fix.
---
Originally reported by qzhjason, imported from: Git plugin failed to evaluate the variable's value for local repo directory when using Git hook
Raw content of original issue
Our project is using a variable to specify the local repository directory for Git, such as "${var}". When triggering builds with Git hook, GitSCM.compareRemoteRevisionWithImpl() uses it's plain text value to retrieve the working directory, eg "workspace/${var}" instead of "workspace/dir". As a result, hook always think new change is found and trigger new builds even there is no new change at all.
I did some debugging and found that the environment variables retrieved when triggered by hooks are less than those when triggered by "Build Now". But I could come up with a quick fix.
Contributor guide
Assessment
This issue has not been assessed yet.