jenkinsci / jenkinsci/git-plugin

[JENKINS-44762] Polling always finds changes when you checkout 2 branches of the same repo in the pipeline

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

Description

I have a jenkins multibranch pipeline that is building the product, the tests and runs them.

The product git repo contains the Jenkinsfile and the GitLab webhook is configured on the product git repo. In order to run the tests i need to :



  • checkout the master branch of the tests git repo - to setup the product (the master can install any supported upgrade path)

  • checkout the maintenance branch of the same tests git repo to run the tests applicable for the product installed

Since the webhook/Jenkins file is configured on the product git repo i have configured scm polling for the master/maintenance branch of the tests git repo.

However whenever the git pooling triggers it always finds changes in the tests git repo although there are none.

 

Note: Just to be clear both branches of the tests git repo are checked out in separate folders.

 

Expected behavior:

The polling should consider the repo+branch combination as a separate entity, i.e.



  • change in tests repo master branch only - trigger a build

  • change in tests repo maintenance branch only - trigger a build

  • change in both tests repo master and maintenance branch - trigger a build

  • no changes in tests repo master/maintenance branches - no build triggered

 

NOTE: Original comment added in https://issues.jenkins-ci.org/browse/JENKINS-39621

---
Originally reported by pgeorgiev, imported from: Polling always finds changes when you checkout 2 branches of the same repo in the pipeline


  • status: Open
  • priority: Major
  • component(s): git-plugin
  • label(s): multibranch, pipeline
  • resolution: Unresolved
  • votes: 5
  • watchers: 15
  • imported: 2025-12-02

Raw content of original issue

I have a jenkins multibranch pipeline that is building the product, the tests and runs them.

The product git repo contains the Jenkinsfile and the GitLab webhook is configured on the product git repo. In order to run the tests i need to :



  • checkout the master branch of the tests git repo - to setup the product (the master can install any supported upgrade path)

  • checkout the maintenance branch of the same tests git repo to run the tests applicable for the product installed

Since the webhook/Jenkins file is configured on the product git repo i have configured scm polling for the master/maintenance branch of the tests git repo.

However whenever the git pooling triggers it always finds changes in the tests git repo although there are none.

 

Note: Just to be clear both branches of the tests git repo are checked out in separate folders.

 

Expected behavior:

The polling should consider the repo+branch combination as a separate entity, i.e.



  • change in tests repo master branch only - trigger a build

  • change in tests repo maintenance branch only - trigger a build

  • change in both tests repo master and maintenance branch - trigger a build

  • no changes in tests repo master/maintenance branches - no build triggered

 

NOTE: Original comment added in https://issues.jenkins-ci.org/browse/JENKINS-39621

environment

```
jenkins 2.46.3

git plugin 3.3.0

pipeline 2.5
```

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.