Skip to content

Refactor appStore._checkoutBranch #8099

Closed

Description

@probablycorey

appStore._checkoutBranch is a 150 line method with a lot going on. It also has a reentrant problem described in #7617 (See below for more notes.)

For maintainability, it makes sense to extract this method into a few methods (or possibly into its own class). This would make it easier to maintain and open up the possibility for it to be unit tested more easily.

notes on #7617

#7617 describes why checkoutBranch becomes reentrant. Basically, if the checkout fails, it emits an error, exits the method, the error handler then takes over and stashes the current changes and calls checkoutBranch again. This is pretty hard to follow and #7617’s goal was to solve this. But when I tried to solve it in #8076 it felt like I was introducing more complexity to an already complex method. So I closed that PR and opened up this one. Now you are all caught up!

Activity

  1. added
    tech-debt
    on Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debt

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions