Skip to content
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

gitBranchExpression should override local git branch if provided #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

impulse-jprice
Copy link

We were using gitBranchExpression to provide the git branch name via environment variables, intending to override the git branch name as can be detected via the git metadata on the filesystem. Since the addition of detecting the git branch name from the local git metadata was added the use of the environment variable seems to have been dropped.

This PR restores that behavior. Now if the environment variable resolves to some string that doesn't contain any additional replacement characters (${ }) it will be used, even if the local git metadata could provide a branch name. The actual git branch name will only be used if the gitBranchExpression is not provided, or doesn't fully resolve.

override git branch detection.

When the environment variable expression provided by
'gitBranchExpression' resolves to some branch name, that was being
ignored in favor of the git branch detected by reading the local git
metadata. Now the local git branch is only used if that variable is
missing or doesn't fully resolve.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 379

  • 10 of 16 (62.5%) changed or added relevant lines in 1 file are covered.
  • 7 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-1.1%) to 72.09%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/main/java/com/e_gineering/maven/gitflowhelper/ScmUtils.java 10 16 62.5%
Files with Coverage Reduction New Missed Lines %
src/main/java/com/e_gineering/maven/gitflowhelper/PlexusLoggerToMavenLog.java 2 19.35%
src/main/java/com/e_gineering/maven/gitflowhelper/ScmUtils.java 5 30.97%
Totals Coverage Status
Change from base Build 377: -1.1%
Covered Lines: 576
Relevant Lines: 799

💛 - Coveralls

@bvarner
Copy link
Contributor

bvarner commented Oct 5, 2018

To clarify: This is a question of priority, correct?

You're wanting the environment variable to override whatever would be detected from the git metadata.

That seems reasonable. Any chance I can talk you into providing test cases to enforce this semantic?

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.

None yet

3 participants