Simplify use of the Merginator.

This commit is contained in:
jregan
2020-08-22 06:40:59 -07:00
parent 007a5327d7
commit 1d91401772
17 changed files with 104 additions and 105 deletions

View File

@@ -63,14 +63,14 @@ func (gr *gitRunner) DeleteWorktreeDir() error {
func (gr *gitRunner) WorktreePath() (string, error) {
if gr.worktreePath == "" {
return "", fmt.Errorf("Empty worktree path")
return "", fmt.Errorf("empty worktree path")
}
return gr.worktreePath, nil
}
func (gr *gitRunner) OriginalGitPath() (string, error) {
if gr.originalGitPath == "" {
return "", fmt.Errorf("Empty git path")
return "", fmt.Errorf("empty git path")
}
return gr.originalGitPath, nil
}
@@ -107,7 +107,7 @@ func (gr *gitRunner) CheckRemoteExistence(remote string) error {
regString := fmt.Sprintf("(?m)^\\s*%s\\s*$", remote)
reg := regexp.MustCompile(regString)
if !reg.MatchString(string(stdoutStderr)) {
return fmt.Errorf("Cannot find remote named %s", remote)
return fmt.Errorf("cannot find remote named %s", remote)
}
logDebug("Remote %s exists", remote)
return nil

View File

@@ -29,7 +29,7 @@ func (v *moduleVersion) Bump(t string) error {
} else if t == "patch" {
v.patch++
} else {
return fmt.Errorf("Invalid version type: %s", t)
return fmt.Errorf("invalid version type: %s", t)
}
return nil
}
@@ -37,14 +37,14 @@ func (v *moduleVersion) Bump(t string) error {
func newModuleVersionFromString(vs string) (moduleVersion, error) {
v := moduleVersion{}
if len(vs) < 1 {
return v, fmt.Errorf("Invalid version string %s", vs)
return v, fmt.Errorf("invalid version string %s", vs)
}
if vs[0] == 'v' {
vs = vs[1:]
}
versions := strings.Split(vs, ".")
if len(versions) != 3 {
return v, fmt.Errorf("Invalid version string %s", vs)
return v, fmt.Errorf("invalid version string %s", vs)
}
major, err := strconv.Atoi(versions[0])
if err != nil {