From 29551667f0c1bca602870caba5921d3abcbe992e Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 8 Nov 2024 06:43:45 -0600 Subject: use go-cmd/cmd --- getPatches.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'getPatches.go') diff --git a/getPatches.go b/getPatches.go index 44f662b..aaaa472 100644 --- a/getPatches.go +++ b/getPatches.go @@ -28,15 +28,15 @@ func (repo *RepoRow) GetPatches(oldname string, newname string) (int, []*Patch) // log.Info("repo userv, develv", userv, develv) gitcmd := []string{"git", "log", "--oneline", oldname + ".." + newname} log.Info("Run:", gitcmd) - err, output := repo.Status.RunCmd(gitcmd) - if err != nil { - log.Info("git failed ", repo.GoPath(), "err =", err) + r := repo.Status.Run(gitcmd) + if r.Error != nil { + log.Info("git failed ", repo.GoPath(), "err =", r.Error) return 0, nil } // patches = strings.Split(output, "\n") - log.Info("Run:", output) - for _, line := range strings.Split(output, "\n") { + log.Info("Run:", r.Stdout) + for _, line := range r.Stdout { line = strings.TrimSpace(line) if line == "" { continue @@ -98,9 +98,9 @@ func (r *RepoList) MakePatchset(setdir string) bool { // git format-patch branch1..branch2 gitcmd := []string{"git", "format-patch", "-o", repodir, develn + ".." + usern} log.Info("Run:", gitcmd) - err, output := repo.Status.RunCmd(gitcmd) - log.Info("output =", output) - if err == nil { + r := repo.Status.Run(gitcmd) + log.Info("output =", r.Stdout) + if r.Error == nil { log.Info("patches made okay for:", repo.GoPath()) continue } -- cgit v1.2.3