mirror of
https://github.com/vbatts/git-validation.git
synced 2024-12-27 16:06:30 +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:
commit
4cee76b1df
3 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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, " "))
|
||||
}
|
||||
|
|
4
main.go
4
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")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue