Selaa lähdekoodia

Fixes Git Commands back tracking in certain cases

main
Eric Amodio 4 vuotta sitten
vanhempi
commit
5901c2db91
17 muutettua tiedostoa jossa 102 lisäystä ja 18 poistoa
  1. +6
    -1
      src/commands/git/branch.ts
  2. +6
    -1
      src/commands/git/cherry-pick.ts
  3. +6
    -1
      src/commands/git/coauthors.ts
  4. +6
    -1
      src/commands/git/fetch.ts
  5. +6
    -1
      src/commands/git/log.ts
  6. +6
    -1
      src/commands/git/merge.ts
  7. +6
    -1
      src/commands/git/pull.ts
  8. +6
    -1
      src/commands/git/push.ts
  9. +6
    -1
      src/commands/git/rebase.ts
  10. +6
    -1
      src/commands/git/reset.ts
  11. +6
    -1
      src/commands/git/revert.ts
  12. +6
    -2
      src/commands/git/search.ts
  13. +6
    -1
      src/commands/git/show.ts
  14. +6
    -1
      src/commands/git/stash.ts
  15. +6
    -1
      src/commands/git/status.ts
  16. +6
    -1
      src/commands/git/switch.ts
  17. +6
    -1
      src/commands/git/tag.ts

+ 6
- 1
src/commands/git/branch.ts Näytä tiedosto

@ -152,6 +152,8 @@ export class BranchGitCommand extends QuickCommand {
title: this.title,
};
let skippedStepTwo = false;
while (this.canStepsContinue(state)) {
context.title = this.title;
@ -170,8 +172,10 @@ export class BranchGitCommand extends QuickCommand {
context.title = getTitle(state.subcommand === 'delete' ? 'Branches' : this.title, state.subcommand);
if (state.counter < 2 || state.repo == null || typeof state.repo === 'string') {
skippedStepTwo = false;
if (context.repos.length === 1) {
if (state.repo == null) {
skippedStepTwo = true;
state.counter++;
}
state.repo = context.repos[0];
@ -203,7 +207,8 @@ export class BranchGitCommand extends QuickCommand {
}
// If we skipped the previous step, make sure we back up past it
if (context.repos.length === 1) {
if (skippedStepTwo) {
skippedStepTwo = false;
state.counter--;
}
}

+ 6
- 1
src/commands/git/cherry-pick.ts Näytä tiedosto

@ -96,12 +96,16 @@ export class CherryPickGitCommand extends QuickCommand {
state.references = [state.references];
}
let skippedStepOne = false;
while (this.canStepsContinue(state)) {
context.title = this.title;
if (state.counter < 1 || state.repo == null || typeof state.repo === 'string') {
skippedStepOne = false;
if (context.repos.length === 1) {
if (state.repo == null) {
skippedStepOne = true;
state.counter++;
}
state.repo = context.repos[0];
@ -137,7 +141,8 @@ export class CherryPickGitCommand extends QuickCommand {
);
if (result === StepResult.Break) {
// If we skipped the previous step, make sure we back up past it
if (context.repos.length === 1) {
if (skippedStepOne) {
skippedStepOne = false;
state.counter--;
}

+ 6
- 1
src/commands/git/coauthors.ts Näytä tiedosto

@ -115,6 +115,8 @@ export class CoAuthorsGitCommand extends QuickCommand {
}
}
let skippedStepOne = false;
while (this.canStepsContinue(state)) {
context.title = this.title;
@ -124,8 +126,10 @@ export class CoAuthorsGitCommand extends QuickCommand {
typeof state.repo === 'string' ||
!context.repos.includes(state.repo)
) {
skippedStepOne = false;
if (context.repos.length === 1) {
if (state.repo == null) {
skippedStepOne = true;
state.counter++;
}
state.repo = context.repos[0];
@ -146,7 +150,8 @@ export class CoAuthorsGitCommand extends QuickCommand {
);
if (result === StepResult.Break) {
// If we skipped the previous step, make sure we back up past it
if (context.repos.length === 1) {
if (skippedStepOne) {
skippedStepOne = false;
state.counter--;
}

+ 6
- 1
src/commands/git/fetch.ts Näytä tiedosto

@ -74,6 +74,8 @@ export class FetchGitCommand extends QuickCommand {
state.repos = [state.repos as any];
}
let skippedStepOne = false;
while (this.canStepsContinue(state)) {
context.title = this.title;
@ -83,8 +85,10 @@ export class FetchGitCommand extends QuickCommand {
state.repos.length === 0 ||
Arrays.isStringArray(state.repos)
) {
skippedStepOne = false;
if (context.repos.length === 1) {
if (state.repos == null) {
skippedStepOne = true;
state.counter++;
}
state.repos = [context.repos[0]];
@ -105,7 +109,8 @@ export class FetchGitCommand extends QuickCommand {
const result = yield* this.confirmStep(state as FetchStepState, context);
if (result === StepResult.Break) {
// If we skipped the previous step, make sure we back up past it
if (context.repos.length === 1) {
if (skippedStepOne) {
skippedStepOne = false;
state.counter--;
}

+ 6
- 1
src/commands/git/log.ts Näytä tiedosto

@ -82,12 +82,16 @@ export class LogGitCommand extends QuickCommand {
title: this.title,
};
let skippedStepOne = false;
while (this.canStepsContinue(state)) {
context.title = this.title;
if (state.counter < 1 || state.repo == null || typeof state.repo === 'string') {
skippedStepOne = false;
if (context.repos.length === 1) {
if (state.repo == null) {
skippedStepOne = true;
state.counter++;
}
state.repo = context.repos[0];
@ -113,7 +117,8 @@ export class LogGitCommand extends QuickCommand {
});
if (result === StepResult.Break) {
// If we skipped the previous step, make sure we back up past it
if (context.repos.length === 1) {
if (skippedStepOne) {
skippedStepOne = false;
state.counter--;
}

+ 6
- 1
src/commands/git/merge.ts Näytä tiedosto

@ -89,12 +89,16 @@ export class MergeGitCommand extends QuickCommand {
state.flags = [];
}
let skippedStepOne = false;
while (this.canStepsContinue(state)) {
context.title = this.title;
if (state.counter < 1 || state.repo == null || typeof state.repo === 'string') {
skippedStepOne = false;
if (context.repos.length === 1) {
if (state.repo == null) {
skippedStepOne = true;
state.counter++;
}
state.repo = context.repos[0];
@ -130,7 +134,8 @@ export class MergeGitCommand extends QuickCommand {
});
if (result === StepResult.Break) {
// If we skipped the previous step, make sure we back up past it
if (context.repos.length === 1) {
if (skippedStepOne) {
skippedStepOne = false;
state.counter--;
}

+ 6
- 1
src/commands/git/pull.ts Näytä tiedosto

@ -74,6 +74,8 @@ export class PullGitCommand extends QuickCommand {
state.repos = [state.repos as any];
}
let skippedStepOne = false;
while (this.canStepsContinue(state)) {
context.title = this.title;
@ -83,8 +85,10 @@ export class PullGitCommand extends QuickCommand {
state.repos.length === 0 ||
Arrays.isStringArray(state.repos)
) {
skippedStepOne = false;
if (context.repos.length === 1) {
if (state.repos == null) {
skippedStepOne = true;
state.counter++;
}
state.repos = [context.repos[0]];
@ -105,7 +109,8 @@ export class PullGitCommand extends QuickCommand {
const result = yield* this.confirmStep(state as PullStepState, context);
if (result === StepResult.Break) {
// If we skipped the previous step, make sure we back up past it
if (context.repos.length === 1) {
if (skippedStepOne) {
skippedStepOne = false;
state.counter--;
}

+ 6
- 1
src/commands/git/push.ts Näytä tiedosto

@ -87,6 +87,8 @@ export class PushGitCommand extends QuickCommand {
state.repos = [state.repos as any];
}
let skippedStepOne = false;
while (this.canStepsContinue(state)) {
context.title = this.title;
@ -96,8 +98,10 @@ export class PushGitCommand extends QuickCommand {
state.repos.length === 0 ||
Arrays.isStringArray(state.repos)
) {
skippedStepOne = false;
if (context.repos.length === 1) {
if (state.repos == null) {
skippedStepOne = true;
state.counter++;
}
state.repos = [context.repos[0]];
@ -127,7 +131,8 @@ export class PushGitCommand extends QuickCommand {
const result = yield* this.confirmStep(state as PushStepState, context);
if (result === StepResult.Break) {
// If we skipped the previous step, make sure we back up past it
if (context.repos.length === 1) {
if (skippedStepOne) {
skippedStepOne = false;
state.counter--;
}

+ 6
- 1
src/commands/git/rebase.ts Näytä tiedosto

@ -90,12 +90,16 @@ export class RebaseGitCommand extends QuickCommand {
state.flags = [];
}
let skippedStepOne = false;
while (this.canStepsContinue(state)) {
context.title = this.title;
if (state.counter < 1 || state.repo == null || typeof state.repo === 'string') {
skippedStepOne = false;
if (context.repos.length === 1) {
if (state.repo == null) {
skippedStepOne = true;
state.counter++;
}
state.repo = context.repos[0];
@ -131,7 +135,8 @@ export class RebaseGitCommand extends QuickCommand {
});
if (result === StepResult.Break) {
// If we skipped the previous step, make sure we back up past it
if (context.repos.length === 1) {
if (skippedStepOne) {
skippedStepOne = false;
state.counter--;
}

+ 6
- 1
src/commands/git/reset.ts Näytä tiedosto

@ -78,12 +78,16 @@ export class ResetGitCommand extends QuickCommand {
state.flags = [];
}
let skippedStepOne = false;
while (this.canStepsContinue(state)) {
context.title = this.title;
if (state.counter < 1 || state.repo == null || typeof state.repo === 'string') {
skippedStepOne = false;
if (context.repos.length === 1) {
if (state.repo == null) {
skippedStepOne = true;
state.counter++;
}
state.repo = context.repos[0];
@ -125,7 +129,8 @@ export class ResetGitCommand extends QuickCommand {
});
if (result === StepResult.Break) {
// If we skipped the previous step, make sure we back up past it
if (context.repos.length === 1) {
if (skippedStepOne) {
skippedStepOne = false;
state.counter--;
}

+ 6
- 1
src/commands/git/revert.ts Näytä tiedosto

@ -80,12 +80,16 @@ export class RevertGitCommand extends QuickCommand {
state.references = [state.references];
}
let skippedStepOne = false;
while (this.canStepsContinue(state)) {
context.title = this.title;
if (state.counter < 1 || state.repo == null || typeof state.repo === 'string') {
skippedStepOne = false;
if (context.repos.length === 1) {
if (state.repo == null) {
skippedStepOne = true;
state.counter++;
}
state.repo = context.repos[0];
@ -127,7 +131,8 @@ export class RevertGitCommand extends QuickCommand {
);
if (result === StepResult.Break) {
// If we skipped the previous step, make sure we back up past it
if (context.repos.length === 1) {
if (skippedStepOne) {
skippedStepOne = false;
state.counter--;
}

+ 6
- 2
src/commands/git/search.ts Näytä tiedosto

@ -107,6 +107,8 @@ export class SearchGitCommand extends QuickCommand {
state.showResultsInView = cfg.showResultsInView;
}
let skippedStepOne = false;
while (this.canStepsContinue(state)) {
context.title = this.title;
@ -116,8 +118,10 @@ export class SearchGitCommand extends QuickCommand {
typeof state.repo === 'string' ||
!context.repos.includes(state.repo)
) {
skippedStepOne = false;
if (context.repos.length === 1) {
if (state.repo == null) {
skippedStepOne = true;
state.counter++;
}
state.repo = context.repos[0];
@ -134,8 +138,8 @@ export class SearchGitCommand extends QuickCommand {
const result = yield* this.pickSearchOperatorStep(state as SearchStepState, context);
if (result === StepResult.Break) {
// If we skipped the previous step, make sure we back up past it
if (context.repos.length === 1) {
state.counter--;
if (skippedStepOne) {
skippedStepOne = false;
}
state.pattern = undefined;

+ 6
- 1
src/commands/git/show.ts Näytä tiedosto

@ -80,6 +80,8 @@ export class ShowGitCommand extends QuickCommand {
title: this.title,
};
let skippedStepOne = false;
while (this.canStepsContinue(state)) {
context.title = this.title;
@ -89,8 +91,10 @@ export class ShowGitCommand extends QuickCommand {
typeof state.repo === 'string' ||
!context.repos.includes(state.repo)
) {
skippedStepOne = false;
if (context.repos.length === 1) {
if (state.repo == null) {
skippedStepOne = true;
state.counter++;
}
state.repo = context.repos[0];
@ -125,7 +129,8 @@ export class ShowGitCommand extends QuickCommand {
});
if (result === StepResult.Break) {
// If we skipped the previous step, make sure we back up past it
if (context.repos.length === 1) {
if (skippedStepOne) {
skippedStepOne = false;
state.counter--;
}

+ 6
- 1
src/commands/git/stash.ts Näytä tiedosto

@ -147,6 +147,8 @@ export class StashGitCommand extends QuickCommand {
title: this.title,
};
let skippedStepTwo = false;
while (this.canStepsContinue(state)) {
context.title = this.title;
@ -165,8 +167,10 @@ export class StashGitCommand extends QuickCommand {
context.title = getTitle(this.title, state.subcommand);
if (state.counter < 2 || state.repo == null || typeof state.repo === 'string') {
skippedStepTwo = false;
if (context.repos.length === 1) {
if (state.repo == null) {
skippedStepTwo = true;
state.counter++;
}
state.repo = context.repos[0];
@ -198,7 +202,8 @@ export class StashGitCommand extends QuickCommand {
}
// If we skipped the previous step, make sure we back up past it
if (context.repos.length === 1) {
if (skippedStepTwo) {
skippedStepTwo = false;
state.counter--;
}
}

+ 6
- 1
src/commands/git/status.ts Näytä tiedosto

@ -60,6 +60,8 @@ export class StatusGitCommand extends QuickCommand {
title: this.title,
};
let skippedStepOne = false;
while (this.canStepsContinue(state)) {
context.title = this.title;
@ -69,8 +71,10 @@ export class StatusGitCommand extends QuickCommand {
typeof state.repo === 'string' ||
!context.repos.includes(state.repo)
) {
skippedStepOne = false;
if (context.repos.length === 1) {
if (state.repo == null) {
skippedStepOne = true;
state.counter++;
}
state.repo = context.repos[0];
@ -98,7 +102,8 @@ export class StatusGitCommand extends QuickCommand {
const result = yield* showRepositoryStatusStep(state as StatusStepState, context);
if (result === StepResult.Break) {
// If we skipped the previous step, make sure we back up past it
if (context.repos.length === 1) {
if (skippedStepOne) {
skippedStepOne = false;
state.counter--;
}

+ 6
- 1
src/commands/git/switch.ts Näytä tiedosto

@ -92,6 +92,8 @@ export class SwitchGitCommand extends QuickCommand {
state.repos = [state.repos] as string[] | Repository[];
}
let skippedStepOne = false;
while (this.canStepsContinue(state)) {
context.title = this.title;
@ -101,8 +103,10 @@ export class SwitchGitCommand extends QuickCommand {
state.repos.length === 0 ||
Arrays.isStringArray(state.repos)
) {
skippedStepOne = false;
if (context.repos.length === 1) {
if (state.repos == null) {
skippedStepOne = true;
state.counter++;
}
state.repos = [context.repos[0]];
@ -125,7 +129,8 @@ export class SwitchGitCommand extends QuickCommand {
});
if (result === StepResult.Break) {
// If we skipped the previous step, make sure we back up past it
if (context.repos.length === 1) {
if (skippedStepOne) {
skippedStepOne = false;
state.counter--;
}

+ 6
- 1
src/commands/git/tag.ts Näytä tiedosto

@ -131,6 +131,8 @@ export class TagGitCommand extends QuickCommand {
title: this.title,
};
let skippedStepTwo = false;
while (this.canStepsContinue(state)) {
context.title = this.title;
@ -147,8 +149,10 @@ export class TagGitCommand extends QuickCommand {
this.subcommand = state.subcommand;
if (state.counter < 2 || state.repo == null || typeof state.repo === 'string') {
skippedStepTwo = false;
if (context.repos.length === 1) {
if (state.repo == null) {
skippedStepTwo = true;
state.counter++;
}
state.repo = context.repos[0];
@ -178,7 +182,8 @@ export class TagGitCommand extends QuickCommand {
}
// If we skipped the previous step, make sure we back up past it
if (context.repos.length === 1) {
if (skippedStepTwo) {
skippedStepTwo = false;
state.counter--;
}
}

Ladataan…
Peruuta
Tallenna