jenkinsci / jenkinsci/git-plugin

[JENKINS-40172] git pipeline scm poll workspace doesn't find git repository

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

Description

The git plugin doesn't appear to find the proper workspace when performing SCM polling on a pipeline job. I use the checkout() step and have set SCM polling to 10 minutes. Every 10 minutes, the polling log shows something along these lines:

Using strategy: Default

[poll] Last Built Revision: Revision 5f6e2e39083ff256ccc9face14f6358a5c522ee4 (origin/master)

No Git repository yet, an initial checkout is required

This line appears in the git plugin code in a section that appears to be the case of "requiresWorkspaceForPolling = true" which is the case when using multiple branches, or when the branch contains wildcards. I haven't yet figured out why it thinks my configuration has multiple branches (it should only have one) but either way the polling via workspace should still work as expected...

When we go through this path, it appears that the pipeline job doesn't get the correct workspace, as the one that we run polling inside does not have the repository checked out.

---
Originally reported by jekeller, imported from: git pipeline scm poll workspace doesn't find git repository


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

Raw content of original issue

The git plugin doesn't appear to find the proper workspace when performing SCM polling on a pipeline job. I use the checkout() step and have set SCM polling to 10 minutes. Every 10 minutes, the polling log shows something along these lines:

Using strategy: Default
[poll] Last Built Revision: Revision 5f6e2e39083ff256ccc9face14f6358a5c522ee4 (origin/master)
No Git repository yet, an initial checkout is required

This line appears in the git plugin code in a section that appears to be the case of "requiresWorkspaceForPolling = true" which is the case when using multiple branches, or when the branch contains wildcards. I haven't yet figured out why it thinks my configuration has multiple branches (it should only have one) but either way the polling via workspace should still work as expected...

When we go through this path, it appears that the pipeline job doesn't get the correct workspace, as the one that we run polling inside does not have the repository checked out.

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.