Skip to content

Commit 4cee76b

Browse files
authored
Merge pull request #17 from wking/test-merges-again
Test merges again and return to using TRAVIS_COMMIT_RANGE
2 parents fe12ea4 + cdd7165 commit 4cee76b

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ before_install:
1111
- mkdir -p $GOPATH/src/github.com/vbatts && ln -sf $(pwd) $GOPATH/src/github.com/vbatts/git-validation && go get ./...
1212

1313
before_script:
14+
- echo $TRAVIS_COMMIT_RANGE
1415
- echo $TRAVIS_COMMIT
1516
- echo $TRAVIS_BRANCH
1617
- echo $TRAVIS_TAG

git/commits.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
// If commitrange is a git still range 12345...54321, then it will be isolated set of commits.
1313
// If commitrange is a single commit, all ancestor commits up through the hash provided.
1414
func Commits(commitrange string) ([]CommitEntry, error) {
15-
cmdArgs := []string{"git", "--no-pager", "log", `--no-merges`, `--pretty=format:%H`, commitrange}
15+
cmdArgs := []string{"git", "--no-pager", "log", `--pretty=format:%H`, commitrange}
1616
if debug() {
1717
logrus.Infof("[git] cmd: %q", strings.Join(cmdArgs, " "))
1818
}

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ func main() {
5050
var commitRange = *flCommitRange
5151
if commitRange == "" {
5252
if strings.ToLower(os.Getenv("TRAVIS")) == "true" && !*flNoTravis {
53-
if os.Getenv("TRAVIS_BRANCH") != "" {
54-
commitRange = fmt.Sprintf("%s..FETCH_HEAD", os.Getenv("TRAVIS_BRANCH"))
53+
if os.Getenv("TRAVIS_COMMIT_RANGE") != "" {
54+
commitRange = strings.Replace("...", "..", os.Getenv("TRAVIS_COMMIT_RANGE"), 1)
5555
} else if os.Getenv("TRAVIS_COMMIT") != "" {
5656
commitRange = os.Getenv("TRAVIS_COMMIT")
5757
}

0 commit comments

Comments
 (0)