Repository navigation
teach getRemotes about handling this error code instead of failing fast - #5298
Merged
Merged
Conversation
This was referenced Jul 31, 2018
| ): Promise<ReadonlyArray<IRemote>> { | ||
| const result = await git(['remote', '-v'], repository.path, 'getRemotes') | ||
| const result = await git(['remote', '-v'], repository.path, 'getRemotes', { | ||
| successExitCodes: new Set<number>([0, 128]), |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
outofambit
reviewed
Jul 31, 2018
| ): Promise<ReadonlyArray<IRemote>> { | ||
| const result = await git(['remote', '-v'], repository.path, 'getRemotes') | ||
| const result = await git(['remote', '-v'], repository.path, 'getRemotes', { | ||
| successExitCodes: new Set([0, 128]), |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| it('returns empty array for directory without a .git directory', async () => { | ||
| const emptyDir = mkdirSync('no-repo-here') | ||
| const repository = new Repository(emptyDir, -1, null, false) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Member
Author
|
🍎 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is related to exercising #5297 and the steps to reproduce this are roughly:
.gitdirectory to something elseInside
AppStore._refreshRepositorythere are a bunch of Git operations that assume themissingflag is in the right state when it runs.My testing shows these two operations did not handle this "folder exists but it's not a Git repository" scenario:
GitStore.loadBranches()GitStore.loadRemotes()I'm going to address the first one in a separate up PR because the app is currently in a loop and doesn't set the repository to
missing=true, but this fix here was easier to address because: