소스 검색

Changes git terminal cmds to execute immediately

main
Eric Amodio 5 년 전
부모
커밋
5b6a44e26a
4개의 변경된 파일8개의 추가작업 그리고 8개의 파일을 삭제
  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 파일 보기

@ -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 파일 보기

@ -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 파일 보기

@ -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 파일 보기

@ -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);
}

불러오는 중...
취소
저장