-
Notifications
You must be signed in to change notification settings - Fork 654
GitVersion doesn't work on Pull-Request #2115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm guessing Jenkins has done a shallow clone or that the repository is otherwise incomplete. Ensure that you have a full clone and that the |
I'm uising this option for checkout: |
Sorry, but that doesn't say me much. I don't use Jenkins myself and can only speak in general terms from the perspective of what GitVersion expects in order to work correctly. You will have to figure out how Jenkins can be adjusted in order to comply with these expectations. |
I have a similar problem, also with a multibranch Jenkins pipeline job. GitVersionTask crashes when building a PR. This is not a shallow clone. I can reproduce it on the command line by setting the
Interestingly, things work when I run Edit: Turns out the two directories are NOT the same. Running |
This is caused by a libgit2sharp bug: libgit2/libgit2sharp#1782 This bug shows up when the remote has multiple fetch refspecs, as is the case when the repo gets cloned by a multibranch Jenkins pipeline job. |
Sometimes we also have to create a local master branch. libgit2sharp bug: libgit2/libgit2sharp#1782 GitVersion bug: GitTools/GitVersion#2115
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions. |
Is there any other solution instead of @ermshiperete's workaround ? |
If there's anything we can do to massage the branches in GitVersion before we invoke the buggy code in libgit2sharp, that may be a venue worth investigating. If you figure out how to circumvent this in GitVersion, we will happily accept a pull request. |
I "fixed" the issue by reconfiguring the SCM to allow local branches to be available :
The documentation for Jenkins integration shall be updated in that way to explicitely state that multi branch pipeline won't work without that specific configuration. |
@jpc-ava if you don't mind can you send us a PR with the proposed changes? |
Uh oh!
There was an error while loading. Please reload this page.
Hi guys!
I'm using a MultiBranch Pipeline jenkins project to build every pull-request on my c# project located in a bitbucket server, gitVersionTask can't build the PR.
In my Pipeline i have used the following command to perform the check-out
git scm
git branch: "${env.BRANCH_NAME}"
The text was updated successfully, but these errors were encountered: