Skip to content

Remove AppStore.getBranchesState #7231

Closed

Description

@iAmWillShepherd

I discovered this after noticing that AppStore._createStash function did not behave as expected. After doing a bit of digging, it turns out that my test repo not being a GitHubRepository was the cause. I confirmed with @desktop/engineering that getting BranchesState does not depend on GitHubRepository.

Problem function

private getBranchesState(repository?: Repository) {
if (!repository || !repository.gitHubRepository) {
return undefined
}
const state = this.repositoryStateCache.get(repository)
return state.branchesState
}

This function should be removed because of the following reasons:

  • repository is optional
  • undefined is returned if the repository.githubRepository is null
  • All functions that use this function are circumventing explicit state access

Basically this function does not follow the patterns we've defined elsewhere.

Activity

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

Metadata

Metadata

Assignees

Labels

tech-debt

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions