Преглед на файлове

Fixes back button with single repo workspaces

Occurs when opened directly with a repo
main
Eric Amodio преди 5 години
родител
ревизия
13dfa90dbf
променени са 11 файла, в които са добавени 66 реда и са изтрити 55 реда
  1. +6
    -5
      src/commands/git/cherry-pick.ts
  2. +6
    -5
      src/commands/git/fetch.ts
  3. +6
    -5
      src/commands/git/merge.ts
  4. +6
    -5
      src/commands/git/pull.ts
  5. +6
    -5
      src/commands/git/push.ts
  6. +6
    -5
      src/commands/git/rebase.ts
  7. +6
    -5
      src/commands/git/reset.ts
  8. +6
    -5
      src/commands/git/revert.ts
  9. +6
    -5
      src/commands/git/search.ts
  10. +6
    -5
      src/commands/git/stash.ts
  11. +6
    -5
      src/commands/git/switch.ts

+ 6
- 5
src/commands/git/cherry-pick.ts Целия файл

@ -77,16 +77,17 @@ export class CherryPickGitCommand extends QuickCommandBase {
protected async *steps(): StepAsyncGenerator {
const state: StepState<State> = this._initialState === undefined ? { counter: 0 } : this._initialState;
let oneRepo = false;
let repos;
let selectedBranchOrTag: GitReference | undefined;
while (true) {
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) {
oneRepo = true;
state.counter++;
state.repo = repos[0];
} else {
@ -138,7 +139,7 @@ export class CherryPickGitCommand extends QuickCommandBase {
const selection: StepSelection<typeof step> = yield step;
if (!this.canPickStepMoveNext(step, state, selection)) {
if (oneRepo) {
if (repos.length === 1) {
break;
}

+ 6
- 5
src/commands/git/fetch.ts Целия файл

@ -46,15 +46,16 @@ export class FetchGitCommand extends QuickCommandBase {
protected async *steps(): StepAsyncGenerator {
const state: StepState<State> = this._initialState === undefined ? { counter: 0 } : this._initialState;
let oneRepo = false;
let repos;
while (true) {
try {
if (state.repos === undefined || state.counter < 1) {
const repos = [...(await Container.git.getOrderedRepositories())];
if (repos === undefined) {
repos = [...(await Container.git.getOrderedRepositories())];
}
if (state.repos === undefined || state.counter < 1) {
if (repos.length === 1) {
oneRepo = true;
state.counter++;
state.repos = [repos[0]];
} else {
@ -149,7 +150,7 @@ export class FetchGitCommand extends QuickCommandBase {
const selection: StepSelection<typeof step> = yield step;
if (!this.canPickStepMoveNext(step, state, selection)) {
if (oneRepo) {
if (repos.length === 1) {
break;
}

+ 6
- 5
src/commands/git/merge.ts Целия файл

@ -66,15 +66,16 @@ export class MergeGitCommand extends QuickCommandBase {
protected async *steps(): StepAsyncGenerator {
const state: StepState<State> = this._initialState === undefined ? { counter: 0 } : this._initialState;
let oneRepo = false;
let repos;
while (true) {
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) {
oneRepo = true;
state.counter++;
state.repo = repos[0];
} else {
@ -127,7 +128,7 @@ export class MergeGitCommand extends QuickCommandBase {
const selection: StepSelection<typeof step> = yield step;
if (!this.canPickStepMoveNext(step, state, selection)) {
if (oneRepo) {
if (repos.length === 1) {
break;
}
continue;

+ 6
- 5
src/commands/git/pull.ts Целия файл

@ -46,15 +46,16 @@ export class PullGitCommand extends QuickCommandBase {
protected async *steps(): StepAsyncGenerator {
const state: StepState<State> = this._initialState === undefined ? { counter: 0 } : this._initialState;
let oneRepo = false;
let repos;
while (true) {
try {
if (state.repos === undefined || state.counter < 1) {
const repos = [...(await Container.git.getOrderedRepositories())];
if (repos === undefined) {
repos = [...(await Container.git.getOrderedRepositories())];
}
if (state.repos === undefined || state.counter < 1) {
if (repos.length === 1) {
oneRepo = true;
state.counter++;
state.repos = [repos[0]];
} else {
@ -115,7 +116,7 @@ export class PullGitCommand extends QuickCommandBase {
const selection: StepSelection<typeof step> = yield step;
if (!this.canPickStepMoveNext(step, state, selection)) {
if (oneRepo) {
if (repos.length === 1) {
break;
}

+ 6
- 5
src/commands/git/push.ts Целия файл

@ -45,15 +45,16 @@ export class PushGitCommand extends QuickCommandBase {
protected async *steps(): StepAsyncGenerator {
const state: StepState<State> = this._initialState === undefined ? { counter: 0 } : this._initialState;
let oneRepo = false;
let repos;
while (true) {
try {
if (state.repos === undefined || state.counter < 1) {
const repos = [...(await Container.git.getOrderedRepositories())];
if (repos === undefined) {
repos = [...(await Container.git.getOrderedRepositories())];
}
if (state.repos === undefined || state.counter < 1) {
if (repos.length === 1) {
oneRepo = true;
state.counter++;
state.repos = [repos[0]];
} else {
@ -114,7 +115,7 @@ export class PushGitCommand extends QuickCommandBase {
const selection: StepSelection<typeof step> = yield step;
if (!this.canPickStepMoveNext(step, state, selection)) {
if (oneRepo) {
if (repos.length === 1) {
break;
}

+ 6
- 5
src/commands/git/rebase.ts Целия файл

@ -70,17 +70,18 @@ export class RebaseGitCommand extends QuickCommandBase {
protected async *steps(): StepAsyncGenerator {
const state: StepState<State> = this._initialState === undefined ? { counter: 0 } : this._initialState;
let oneRepo = false;
let repos;
let selectedBranchOrTag: GitReference | undefined;
let pickCommit = false;
while (true) {
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) {
oneRepo = true;
state.counter++;
state.repo = repos[0];
} else {
@ -163,7 +164,7 @@ export class RebaseGitCommand extends QuickCommandBase {
const selection: StepSelection<typeof step> = yield step;
if (!this.canPickStepMoveNext(step, state, selection)) {
if (oneRepo) {
if (repos.length === 1) {
break;
}
continue;

+ 6
- 5
src/commands/git/reset.ts Целия файл

@ -58,15 +58,16 @@ export class ResetGitCommand extends QuickCommandBase {
protected async *steps(): StepAsyncGenerator {
const state: StepState<State> = this._initialState === undefined ? { counter: 0 } : this._initialState;
let oneRepo = false;
let repos;
while (true) {
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) {
oneRepo = true;
state.counter++;
state.repo = repos[0];
} else {
@ -131,7 +132,7 @@ export class ResetGitCommand extends QuickCommandBase {
const selection: StepSelection<typeof step> = yield step;
if (!this.canPickStepMoveNext(step, state, selection)) {
if (oneRepo) {
if (repos.length === 1) {
break;
}
continue;

+ 6
- 5
src/commands/git/revert.ts Целия файл

@ -65,15 +65,16 @@ export class RevertGitCommand extends QuickCommandBase {
protected async *steps(): StepAsyncGenerator {
const state: StepState<State> = this._initialState === undefined ? { counter: 0 } : this._initialState;
let oneRepo = false;
let repos;
while (true) {
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) {
oneRepo = true;
state.counter++;
state.repo = repos[0];
} else {
@ -141,7 +142,7 @@ export class RevertGitCommand extends QuickCommandBase {
const selection: StepSelection<typeof step> = yield step;
if (!this.canPickStepMoveNext(step, state, selection)) {
if (oneRepo) {
if (repos.length === 1) {
break;
}
continue;

+ 6
- 5
src/commands/git/search.ts Целия файл

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

+ 6
- 5
src/commands/git/stash.ts Целия файл

@ -122,7 +122,7 @@ export class StashGitCommand extends QuickCommandBase {
protected async *steps(): StepAsyncGenerator {
const state: StepState<State> = this._initialState === undefined ? { counter: 0 } : this._initialState;
let oneRepo = false;
let repos;
while (true) {
try {
@ -167,11 +167,12 @@ export class StashGitCommand extends QuickCommandBase {
this._subcommand = state.subcommand;
if (state.repo === undefined || state.counter < 2) {
const repos = [...(await Container.git.getOrderedRepositories())];
if (repos === undefined) {
repos = [...(await Container.git.getOrderedRepositories())];
}
if (state.repo === undefined || state.counter < 2) {
if (repos.length === 1) {
oneRepo = true;
state.counter++;
state.repo = repos[0];
} else {
@ -213,7 +214,7 @@ export class StashGitCommand extends QuickCommandBase {
return undefined;
}
if (oneRepo) {
if (repos.length === 1) {
state.counter--;
}
continue;

+ 6
- 5
src/commands/git/switch.ts Целия файл

@ -76,16 +76,17 @@ export class SwitchGitCommand extends QuickCommandBase {
protected async *steps(): StepAsyncGenerator {
const state: StepState<State> = this._initialState === undefined ? { counter: 0 } : this._initialState;
let oneRepo = false;
let repos;
let showTags = false;
while (true) {
try {
if (state.repos === undefined || state.counter < 1) {
const repos = [...(await Container.git.getOrderedRepositories())];
if (repos === undefined) {
repos = [...(await Container.git.getOrderedRepositories())];
}
if (state.repos === undefined || state.counter < 1) {
if (repos.length === 1) {
oneRepo = true;
state.counter++;
state.repos = [repos[0]];
} else {
@ -171,7 +172,7 @@ export class SwitchGitCommand extends QuickCommandBase {
const selection: StepSelection<typeof step> = yield step;
if (!this.canPickStepMoveNext(step, state, selection)) {
if (oneRepo) {
if (repos.length === 1) {
break;
}

Зареждане…
Отказ
Запис