diff options
| author | Jeff Carr <[email protected]> | 2025-10-09 20:28:54 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-09 20:28:54 -0500 |
| commit | 71a0b8f19f52dc43e5f4bdfde78eae85fbc7f74e (patch) | |
| tree | ae74169af0134a6b3157b44525d5ad0e1b09b950 /doCommit.go | |
| parent | c3b8d8ae037fc7fa6d63208d430ce9cb28201c6b (diff) | |
more standard function handling
Diffstat (limited to 'doCommit.go')
| -rw-r--r-- | doCommit.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/doCommit.go b/doCommit.go index 5539c54..9a24263 100644 --- a/doCommit.go +++ b/doCommit.go @@ -4,12 +4,14 @@ package main import ( + "errors" + "go.wit.com/lib/config" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" ) -func doCommit() error { +func doCommit() (string, error) { if argv.Commit.All || argv.All { found := me.forge.CheckDirty() var newpatches bool @@ -25,7 +27,7 @@ func doCommit() error { config.SetChanged("repos", true) return doPatchSubmit() } - okExit("") + return "git ommit --all done", nil } repo := findCurrentPwdRepoOrDie() @@ -39,15 +41,16 @@ func doCommit() error { if repo.GetCurrentBranchName() != repo.GetUserBranchName() { found := new(gitpb.Repos) found.Append(repo) - me.forge.PrintHumanTable(found) + footer := me.forge.PrintHumanTable(found) + log.Info(footer) log.Info("") log.Info("wrong branch. Can not commit on", repo.GetCurrentBranchName()) log.Info("") - okExit("") + return "repo must be on user branch", errors.New("repo must be on user branch") } if err := repo.GitCommit(); err != nil { - badExit(err) + return "git commit --all", err } return doPatchSubmit() |
