Skip to content

Commit 5b6a44e

Browse files
committed
Changes git terminal cmds to execute immediately
1 parent 9447113 commit 5b6a44e

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/commands/quick/cherry-pick.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ interface State {
1818

1919
export class CherryPickQuickCommand extends GitCommandBase {
2020
constructor() {
21-
super('cherry-pick', 'Cherry Pick');
21+
super('cherry-pick', 'Cherry Pick', { description: 'via Terminal' });
2222
}
2323

2424
execute(state: State) {
2525
// Ensure the commits are ordered with the oldest first
2626
state.commits.sort((a, b) => a.date.getTime() - b.date.getTime());
27-
runGitCommandInTerminal('cherry-pick', state.commits.map(c => c.sha).join(' '), state.repo.path);
27+
runGitCommandInTerminal('cherry-pick', state.commits.map(c => c.sha).join(' '), state.repo.path, true);
2828
}
2929

3030
async *steps(): AsyncIterableIterator<QuickPickStep> {

src/commands/quick/merge.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ interface State {
1818

1919
export class MergeQuickCommand extends GitCommandBase {
2020
constructor() {
21-
super('merge', 'Merge');
21+
super('merge', 'Merge', { description: 'via Terminal' });
2222
}
2323

2424
execute(state: State) {
25-
runGitCommandInTerminal('merge', [...state.flags, state.source.ref].join(' '), state.repo.path);
25+
runGitCommandInTerminal('merge', [...state.flags, state.source.ref].join(' '), state.repo.path, true);
2626
}
2727

2828
async *steps(): AsyncIterableIterator<QuickPickStep> {

src/commands/quick/rebase.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ interface State {
1818

1919
export class RebaseQuickCommand extends GitCommandBase {
2020
constructor() {
21-
super('rebase', 'Rebase');
21+
super('rebase', 'Rebase', { description: 'via Terminal' });
2222
}
2323

2424
execute(state: State) {
25-
runGitCommandInTerminal('rebase', [...state.flags, state.source.ref].join(' '), state.repo.path);
25+
runGitCommandInTerminal('rebase', [...state.flags, state.source.ref].join(' '), state.repo.path, true);
2626
}
2727

2828
async *steps(): AsyncIterableIterator<QuickPickStep> {

src/terminal.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ function ensureTerminal(cwd: string): Terminal {
3030
return _terminal;
3131
}
3232

33-
export function runGitCommandInTerminal(command: string, args: string, cwd: string) {
33+
export function runGitCommandInTerminal(command: string, args: string, cwd: string, execute: boolean = false) {
3434
// let git = GitService.getGitPath();
3535
// if (git.includes(' ')) {
3636
// git = `"${git}"`;
3737
// }
3838

3939
const terminal = ensureTerminal(cwd);
4040
terminal.show(false);
41-
terminal.sendText(`git ${command} ${args}`, false);
41+
terminal.sendText(`git ${command} ${args}`, execute);
4242
}

0 commit comments

Comments
 (0)