Git plugin fetches all branches before fetching the specified refspec

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major
    • Component/s: git-plugin
    • Environment:
      Jenkins 1.609.1, Git plugin 2.4.0, Git Client plugin 1.18.0, Centos 6

      We have a project in several branches where just one branch is needed to build at a time. Some other branches contain a lot of unneeded data. The correct refspec is specified in the job's configuration. But when the job is run, Jenkins first downloads all the refs:
      > /usr/bin/git -c core.askpass=true fetch --tags --progress **url here** +refs/heads/:refs/remotes/origin/ # timeout=30
      Only then, after adding the remote and other operations, it uses the specified ref:
      > /usr/bin/git -c core.askpass=true fetch --tags --progress **url here** +refs/heads/master:refs/remotes/origin/master # timeout=30
      This leads to a big waste of time, as lots of data is actually downloaded but not used at all.

            Assignee:
            Unassigned
            Reporter:
            Marco Sacchetto
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: