diff --git a/.travis.yml b/.travis.yml index 683f5f8..db33fc0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 ./... before_script: + - echo $TRAVIS_COMMIT_RANGE - echo $TRAVIS_COMMIT - echo $TRAVIS_BRANCH - echo $TRAVIS_TAG diff --git a/git/commits.go b/git/commits.go index ef99a77..5249e0b 100644 --- a/git/commits.go +++ b/git/commits.go @@ -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 single commit, all ancestor commits up through the hash provided. 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() { logrus.Infof("[git] cmd: %q", strings.Join(cmdArgs, " ")) } diff --git a/main.go b/main.go index 65d4bb0..36d0f77 100644 --- a/main.go +++ b/main.go @@ -50,8 +50,8 @@ func main() { var commitRange = *flCommitRange if commitRange == "" { if strings.ToLower(os.Getenv("TRAVIS")) == "true" && !*flNoTravis { - if os.Getenv("TRAVIS_BRANCH") != "" { - commitRange = fmt.Sprintf("%s..FETCH_HEAD", os.Getenv("TRAVIS_BRANCH")) + if os.Getenv("TRAVIS_COMMIT_RANGE") != "" { + commitRange = strings.Replace("...", "..", os.Getenv("TRAVIS_COMMIT_RANGE"), 1) } else if os.Getenv("TRAVIS_COMMIT") != "" { commitRange = os.Getenv("TRAVIS_COMMIT") }