diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -8,6 +8,7 @@ import ( "go.wit.com/dev/alexflint/arg" "go.wit.com/gui" + "go.wit.com/lib/gui/shell" "go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" @@ -60,6 +61,26 @@ func main() { okExit("") } + if argv.Commit != nil { + pwd, _ := os.Getwd() + repo := me.forge.Repos.FindByFullPath(pwd) + if repo == nil { + log.Info("what branch are you on?: todo: examine this") + okExit("") + } + if repo.GetCurrentBranchName() != repo.GetUserBranchName() { + me.found.Append(repo) + me.forge.PrintHumanTable(me.found) + log.Info("") + log.Info("wrong branch. Can not commit on", repo.GetCurrentBranchName()) + log.Info("") + okExit("") + } + shell.Exec([]string{"git", "diff"}) + shell.Exec([]string{"git", "commit", "--all"}) + okExit("forge done") + } + if argv.Checkout != nil { if argv.Checkout.User != nil { if argv.Force { |
