Environment:Windows and Linux slaves running Jenkins 1.509.4, Git plugin 2.0, Git client plugin 1.4.5
A Jenkins job configured with the Git plugin using the JGit implementation will execute the job at each polling interval, even when there were no changes on the git repository.
The same job, configured with the Git plugin using the git command line implementation only executes the job when there were changes in the git repository.
The problem is visible with both a git protocol repository and with a GitHub repository using the https protocol.
Sample job definitions which show the problem are attached. The job definitions with "jgit" in the XML file name show the problem. The job definitions with "cli" in the XML file name do not show the problem.
There is a simple work around for the problem. Add the "Force polling using workspace" to the job configuration through the "Additional Behaviours" section of the git plugin configuration for the job. That avoids the problem "ls-remote" in the JGit plugin implementation. Unfortunately, it also slows the polling process in those cases where the repository does not already exist
Another work around is to remove wildcards from the branch name in the job definition. Unfortunately, that removes the ability to monitor multiple branches with a single Jenkins job.