Ver a proveniência

Changes git terminal cmds to execute immediately

main
Eric Amodio há 5 anos
ascendente
cometimento
5b6a44e26a
4 ficheiros alterados com 8 adições e 8 eliminações
  1. +2
    -2
      src/commands/quick/cherry-pick.ts
  2. +2
    -2
      src/commands/quick/merge.ts
  3. +2
    -2
      src/commands/quick/rebase.ts
  4. +2
    -2
      src/terminal.ts

+ 2
- 2
src/commands/quick/cherry-pick.ts Ver ficheiro

@ -18,13 +18,13 @@ interface State {
export class CherryPickQuickCommand extends GitCommandBase {
constructor() {
super('cherry-pick', 'Cherry Pick');
super('cherry-pick', 'Cherry Pick', { description: 'via Terminal' });
}
execute(state: State) {
// Ensure the commits are ordered with the oldest first
state.commits.sort((a, b) => a.date.getTime() - b.date.getTime());
runGitCommandInTerminal('cherry-pick', state.commits.map(c => c.sha).join(' '), state.repo.path);
runGitCommandInTerminal('cherry-pick', state.commits.map(c => c.sha).join(' '), state.repo.path, true);
}
async *steps(): AsyncIterableIterator<QuickPickStep> {

+ 2
- 2
src/commands/quick/merge.ts Ver ficheiro

@ -18,11 +18,11 @@ interface State {
export class MergeQuickCommand extends GitCommandBase {
constructor() {
super('merge', 'Merge');
super('merge', 'Merge', { description: 'via Terminal' });
}
execute(state: State) {
runGitCommandInTerminal('merge', [...state.flags, state.source.ref].join(' '), state.repo.path);
runGitCommandInTerminal('merge', [...state.flags, state.source.ref].join(' '), state.repo.path, true);
}
async *steps(): AsyncIterableIterator<QuickPickStep> {

+ 2
- 2
src/commands/quick/rebase.ts Ver ficheiro

@ -18,11 +18,11 @@ interface State {
export class RebaseQuickCommand extends GitCommandBase {
constructor() {
super('rebase', 'Rebase');
super('rebase', 'Rebase', { description: 'via Terminal' });
}
execute(state: State) {
runGitCommandInTerminal('rebase', [...state.flags, state.source.ref].join(' '), state.repo.path);
runGitCommandInTerminal('rebase', [...state.flags, state.source.ref].join(' '), state.repo.path, true);
}
async *steps(): AsyncIterableIterator<QuickPickStep> {

+ 2
- 2
src/terminal.ts Ver ficheiro

@ -30,7 +30,7 @@ function ensureTerminal(cwd: string): Terminal {
return _terminal;
}
export function runGitCommandInTerminal(command: string, args: string, cwd: string) {
export function runGitCommandInTerminal(command: string, args: string, cwd: string, execute: boolean = false) {
// let git = GitService.getGitPath();
// if (git.includes(' ')) {
// git = `"${git}"`;
@ -38,5 +38,5 @@ export function runGitCommandInTerminal(command: string, args: string, cwd: stri
const terminal = ensureTerminal(cwd);
terminal.show(false);
terminal.sendText(`git ${command} ${args}`, false);
terminal.sendText(`git ${command} ${args}`, execute);
}

Carregando…
Cancelar
Guardar