|
@ -75,7 +75,7 @@ export class SearchGitCommand extends QuickCommandBase { |
|
|
|
|
|
|
|
|
protected async *steps(): StepAsyncGenerator { |
|
|
protected async *steps(): StepAsyncGenerator { |
|
|
const state: StepState<State> = this._initialState === undefined ? { counter: 0 } : this._initialState; |
|
|
const state: StepState<State> = this._initialState === undefined ? { counter: 0 } : this._initialState; |
|
|
let oneRepo = false; |
|
|
|
|
|
|
|
|
let repos; |
|
|
let pickedCommit: GitLogCommit | undefined; |
|
|
let pickedCommit: GitLogCommit | undefined; |
|
|
let resultsKey: string | undefined; |
|
|
let resultsKey: string | undefined; |
|
|
let resultsPromise: Promise<GitLog | undefined> | undefined; |
|
|
let resultsPromise: Promise<GitLog | undefined> | undefined; |
|
@ -96,11 +96,12 @@ export class SearchGitCommand extends QuickCommandBase { |
|
|
|
|
|
|
|
|
while (true) { |
|
|
while (true) { |
|
|
try { |
|
|
try { |
|
|
if (state.repo === undefined || state.counter < 1) { |
|
|
|
|
|
const repos = [...(await Container.git.getOrderedRepositories())]; |
|
|
|
|
|
|
|
|
if (repos === undefined) { |
|
|
|
|
|
repos = [...(await Container.git.getOrderedRepositories())]; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (state.repo === undefined || state.counter < 1) { |
|
|
if (repos.length === 1) { |
|
|
if (repos.length === 1) { |
|
|
oneRepo = true; |
|
|
|
|
|
state.counter++; |
|
|
state.counter++; |
|
|
state.repo = repos[0]; |
|
|
state.repo = repos[0]; |
|
|
} else { |
|
|
} else { |
|
@ -360,7 +361,7 @@ export class SearchGitCommand extends QuickCommandBase { |
|
|
const selection: StepSelection<typeof step> = yield step; |
|
|
const selection: StepSelection<typeof step> = yield step; |
|
|
|
|
|
|
|
|
if (!this.canPickStepMoveNext(step, state, selection)) { |
|
|
if (!this.canPickStepMoveNext(step, state, selection)) { |
|
|
if (oneRepo) { |
|
|
|
|
|
|
|
|
if (repos.length === 1) { |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|