Skip to content

Fix to stop GitVersion from introducing the remote name into branch name - #911

Merged
JakeGinnivan merged 3 commits into
GitTools:masterfrom
bdbehrho:feature/DontUseRemoteNameWhenCopyingRemoteBranch
Jun 25, 2016
Merged

JakeGinnivan merged 3 commits into
GitTools:masterfrom
bdbehrho:feature/DontUseRemoteNameWhenCopyingRemoteBranch

Conversation

@bdbehrho

@bdbehrho bdbehrho commented Jun 23, 2016 •

Copy link
Copy Markdown

When using GitVersion on a Jenkins build server, the remote name was getting introduced into the branch name when NormalizeGitDirectory was called. I found this to be happening because in the Jenkins GetCurrentBranch method, it was getting the environment variable "GIT_BRANCH" which would be something like "origin/master". There is now a variable available in Git called "GIT_LOCAL_BRANCH" that would just return "master" without the remote name, so I changed Jenkins.cs to use that variable instead unless it is not defined. I also added a simple test to EnvironmentVariableJenkinsTests.cs

Fixes #857

@bdbehrho bdbehrho changed the title Possible Fix to Issue #857 Fix to stop GitVersion from introducing the remote name into branch name Jun 23, 2016
@JakeGinnivan
JakeGinnivan merged commit 38b8fb1 into GitTools:master Jun 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants