-
Notifications
You must be signed in to change notification settings - Fork 658
Closed
Description
I'm runing GitVersion 4.0 in Jenkins via Declarative Pipelines. I've just added the bitbucket git option Discover pull requests from origin
with the Strategy Merging the pull request with the current target branch
. The build is failing with the following error
WARN [10/17/17 10:35:06:32] An error occurred:
2 remote(s) have been detected. When being run on a build server, the Git repository is expected to bear one (and no more than one) remote.
script returned exit code 1
I think the bug is at GitPreparer.cs#L80 it is only looking for an extra remote called origin1
but it seems my extra is called upstream
Cloning the remote Git repository
Cloning repository https://bitbucket.org/myorg/myrepo.git
> git init C:\jenkins\workspace\PR-13-AXCABYUQMF3JULDPTND3225WKKFRDI54QHU4ML2JLTT7TOHTZBBA # timeout=10
Fetching upstream changes from https://bitbucket.org/myorg/myrepo.git
> git --version # timeout=10
using GIT_ASKPASS to set credentials Bitbucket server credentials
> git fetch --tags --progress https://bitbucket.org/myorg/myrepo.git +refs/heads/*:refs/remotes/origin/*
> git config remote.origin.url https://bitbucket.org/myorg/myrepo.git # timeout=10
> git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
> git config remote.origin.url https://bitbucket.org/myorg/myrepo.git # timeout=10
Fetching upstream changes from https://bitbucket.org/myorg/myrepo.git
using GIT_ASKPASS to set credentials Bitbucket server credentials
> git fetch --tags --progress https://bitbucket.org/myorg/myrepo.git +refs/heads/feature/fix-package-dependencies:refs/remotes/origin/PR-13
> git config remote.upstream.url https://bitbucket.org/myorg/myrepo.git # timeout=10
Fetching upstream changes from https://bitbucket.org/myorg/myrepo.git
using GIT_ASKPASS to set credentials Bitbucket server credentials
> git fetch --tags --progress https://bitbucket.org/myorg/myrepo.git +refs/heads/master:refs/remotes/upstream/master
Merging remotes/upstream/master commit 0666b623e0959b44d4a733ce54e43f349bc4a446 into PR head commit 36604f0452a9ffd861edac8f204093e0f4c68ce0
> git config core.sparsecheckout # timeout=10
> git checkout -f 36604f0452a9ffd861edac8f204093e0f4c68ce0
> git merge 0666b623e0959b44d4a733ce54e43f349bc4a446 # timeout=10
> git rev-parse "HEAD^{commit}" # timeout=10
Merge succeeded, producing 36604f0452a9ffd861edac8f204093e0f4c68ce0
Checking out Revision 36604f0452a9ffd861edac8f204093e0f4c68ce0 (PR-13)
> git config core.sparsecheckout # timeout=10
> git checkout -f 36604f0452a9ffd861edac8f204093e0f4c68ce0
I'm happy to do a pull request to fix this if you confirm this is a bug.
Metadata
Metadata
Assignees
Labels
No labels