Skip to content

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

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

Merged
merged 3 commits into from
Jun 25, 2016
Merged

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

merged 3 commits into from
Jun 25, 2016

Conversation

bdbehrho
Copy link

@bdbehrho bdbehrho commented Jun 23, 2016

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