Skip to content

Commit a0fa353

Browse files
committed
2 parents 11080b8 + bfd283b commit a0fa353

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

app/src/lib/stores/app-store.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5801,7 +5801,10 @@ export class AppStore extends TypedBaseStore<IAppState> {
58015801
}
58025802

58035803
/** This shouldn't be called directly. See `Dispatcher`. */
5804-
private async performPull(repository: Repository): Promise<void> {
5804+
private async performPull(
5805+
repository: Repository,
5806+
allowRetry = true
5807+
): Promise<void> {
58055808
return this.withPushPullFetch(repository, async () => {
58065809
const gitStore = this.gitStoreCache.get(repository)
58075810

@@ -5826,6 +5829,14 @@ export class AppStore extends TypedBaseStore<IAppState> {
58265829
throw new Error('The current repository is in a detached HEAD state.')
58275830
}
58285831

5832+
if (tip.kind === TipState.Unknown && allowRetry) {
5833+
console.warn(
5834+
`Repo ${repository.name} was in an unknown state (not loaded) when trying to pull. Refreshing repository and trying again.`
5835+
)
5836+
await this._refreshRepository(repository)
5837+
return this.performPull(repository, false)
5838+
}
5839+
58295840
if (tip.kind === TipState.Valid) {
58305841
let mergeBase: string | null = null
58315842
let gitContext: GitErrorContext | undefined = undefined

0 commit comments

Comments
 (0)