Merge pull request #11243 from desktop/something-about-einstein-and-doing-the-same-thing-over-and-over-again

Don't attempt to check out the currently checked out branch
This commit is contained in:
Markus Olsson 2020-12-18 11:25:15 +01:00 committed by GitHub
commit 2f6de415d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3060,6 +3060,11 @@ export class AppStore extends TypedBaseStore<IAppState> {
const { tip } = branchesState
const hasChanges = changesState.workingDirectory.files.length > 0
// No point in checking out the currently checked out branch.
if (tip.kind === TipState.Valid && tip.branch.name === branch.name) {
return repository
}
let strategy = explicitStrategy ?? this.uncommittedChangesStrategy
// The user hasn't been presented with an explicit choice