1
0
Fork 0
mirror of https://github.com/vbatts/git-validation.git synced 2024-11-26 01:55:40 +00:00

Merge pull request #17 from wking/test-merges-again

Test merges again and return to using TRAVIS_COMMIT_RANGE
This commit is contained in:
Vincent Batts 2017-03-21 17:58:56 -04:00 committed by GitHub
commit 4cee76b1df
3 changed files with 4 additions and 3 deletions

View file

@ -11,6 +11,7 @@ before_install:
- mkdir -p $GOPATH/src/github.com/vbatts && ln -sf $(pwd) $GOPATH/src/github.com/vbatts/git-validation && go get ./... - mkdir -p $GOPATH/src/github.com/vbatts && ln -sf $(pwd) $GOPATH/src/github.com/vbatts/git-validation && go get ./...
before_script: before_script:
- echo $TRAVIS_COMMIT_RANGE
- echo $TRAVIS_COMMIT - echo $TRAVIS_COMMIT
- echo $TRAVIS_BRANCH - echo $TRAVIS_BRANCH
- echo $TRAVIS_TAG - echo $TRAVIS_TAG

View file

@ -12,7 +12,7 @@ import (
// If commitrange is a git still range 12345...54321, then it will be isolated set of commits. // If commitrange is a git still range 12345...54321, then it will be isolated set of commits.
// If commitrange is a single commit, all ancestor commits up through the hash provided. // If commitrange is a single commit, all ancestor commits up through the hash provided.
func Commits(commitrange string) ([]CommitEntry, error) { func Commits(commitrange string) ([]CommitEntry, error) {
cmdArgs := []string{"git", "--no-pager", "log", `--no-merges`, `--pretty=format:%H`, commitrange} cmdArgs := []string{"git", "--no-pager", "log", `--pretty=format:%H`, commitrange}
if debug() { if debug() {
logrus.Infof("[git] cmd: %q", strings.Join(cmdArgs, " ")) logrus.Infof("[git] cmd: %q", strings.Join(cmdArgs, " "))
} }

View file

@ -50,8 +50,8 @@ func main() {
var commitRange = *flCommitRange var commitRange = *flCommitRange
if commitRange == "" { if commitRange == "" {
if strings.ToLower(os.Getenv("TRAVIS")) == "true" && !*flNoTravis { if strings.ToLower(os.Getenv("TRAVIS")) == "true" && !*flNoTravis {
if os.Getenv("TRAVIS_BRANCH") != "" { if os.Getenv("TRAVIS_COMMIT_RANGE") != "" {
commitRange = fmt.Sprintf("%s..FETCH_HEAD", os.Getenv("TRAVIS_BRANCH")) commitRange = strings.Replace("...", "..", os.Getenv("TRAVIS_COMMIT_RANGE"), 1)
} else if os.Getenv("TRAVIS_COMMIT") != "" { } else if os.Getenv("TRAVIS_COMMIT") != "" {
commitRange = os.Getenv("TRAVIS_COMMIT") commitRange = os.Getenv("TRAVIS_COMMIT")
} }