Skip to content

Conversation

shiftkey
Copy link
Member

Overview

Related to #7445

Description

As part of sketching out the Git APIs I'd need to address rebase conflict detection I realised that I'd need worktrees, but they don't satisfy the Repository type because:

  • they aren't stored in IndexedDB
  • they aren't directly associated with a GitHub repository

Initially I went with building out APIs that worked against the worktree abstraction, but that felt suboptimal because I'd now need to support APIs that worked both against repositories and worktrees.

While refreshing myself about #7445 I realised that all our Git APIs only need the path to the repository, so that's where this OnDiskRepository type came from. Rather than refactor them all now, I'm going to:

This also has the benefit of making much of our repository setup where we've hard-coded values to satisfy the Repository type unnecessary:

export async function setupEmptyRepository(): Promise<Repository> {
const repoPath = mkdirSync('desktop-empty-repo-')
await GitProcess.exec(['init'], repoPath)
return new Repository(repoPath, -1, null, false)
}

Release notes

Notes: no-notes

@shiftkey shiftkey added tech-debt Issues and pull requests related to addressing technical debt or improving the codebase ready-for-review Pull Requests that are ready to be reviewed by the maintainers labels Jun 17, 2019
@shiftkey shiftkey removed the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jun 28, 2019
@shiftkey
Copy link
Member Author

Closing this out for now because I'm no longer working on this feature.

@outofambit I'm going to leave the branch up in case you want to reuse the commits.

@shiftkey shiftkey closed this Jun 28, 2019
@shiftkey shiftkey deleted the shiftkey/conflicts/introduce-abstraction branch July 22, 2019 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech-debt Issues and pull requests related to addressing technical debt or improving the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant