diff options
| author | Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com> | 2018-12-10 16:13:06 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-10 16:13:06 +0300 |
| commit | 93da26433ad15e1c46904a2d417d8f6d8eeaec4f (patch) | |
| tree | a84993cb88bb5fd8f319a0ff04aced36d823ab17 /pkg/gui/branchview.go | |
| parent | Merge pull request #29 from isacikgoz/develop (diff) | |
| parent | minor bugfix and some polishment on code style (diff) | |
| download | gitbatch-93da26433ad15e1c46904a2d417d8f6d8eeaec4f.tar.gz | |
Merge pull request #31 from isacikgoz/develop
minor bugfix and some polishment on code style
Diffstat (limited to 'pkg/gui/branchview.go')
| -rw-r--r-- | pkg/gui/branchview.go | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/pkg/gui/branchview.go b/pkg/gui/branchview.go index c955cf0..f69a212 100644 --- a/pkg/gui/branchview.go +++ b/pkg/gui/branchview.go @@ -26,10 +26,8 @@ func (gui *Gui) updateBranch(g *gocui.Gui, entity *git.RepoEntity) error { } fmt.Fprintln(out, tab+b.Name) } - if err = gui.smartAnchorRelativeToLine(out, currentindex, totalbranches); err != nil { - return err - } - return nil + err = gui.smartAnchorRelativeToLine(out, currentindex, totalbranches) + return err } // iteration handler for the branchview @@ -37,17 +35,13 @@ func (gui *Gui) nextBranch(g *gocui.Gui, v *gocui.View) error { var err error entity := gui.getSelectedRepository() if err = entity.Checkout(entity.NextBranch()); err != nil { - if err = gui.openErrorView(g, err.Error(), + err = gui.openErrorView(g, err.Error(), "You should manually resolve this issue", - branchViewFeature.Name); err != nil { - return err - } - return nil - } - if err = gui.checkoutFollowUp(g, entity); err != nil { + branchViewFeature.Name) return err } - return nil + err = gui.checkoutFollowUp(g, entity) + return err } // iteration handler for the branchview @@ -55,17 +49,13 @@ func (gui *Gui) previousBranch(g *gocui.Gui, v *gocui.View) error { var err error entity := gui.getSelectedRepository() if err = entity.Checkout(entity.PreviousBranch()); err != nil { - if err = gui.openErrorView(g, err.Error(), + err = gui.openErrorView(g, err.Error(), "You should manually resolve this issue", - branchViewFeature.Name); err != nil { - return err - } - return nil - } - if err = gui.checkoutFollowUp(g, entity); err != nil { + branchViewFeature.Name) return err } - return nil + err = gui.checkoutFollowUp(g, entity) + return err } // after checkout a branch some refreshments needed @@ -79,8 +69,6 @@ func (gui *Gui) checkoutFollowUp(g *gocui.Gui, entity *git.RepoEntity) (err erro if err = gui.updateRemoteBranches(g, entity); err != nil { return err } - if err = gui.refreshMain(g); err != nil { - return err - } - return nil + err = gui.refreshMain(g) + return err } |
