Skip to content

Commit 61deced

Browse files
authored
Git - fix git.stageFile and git.unstageFile commands so that they work when invoked using a keybinding (microsoft#258771)
1 parent 50bb1f1 commit 61deced

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

extensions/git/src/commands.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,6 +1792,8 @@ export class CommandCenter {
17921792

17931793
@command('git.stageFile')
17941794
async stageFile(uri: Uri): Promise<void> {
1795+
uri = uri ?? window.activeTextEditor?.document.uri;
1796+
17951797
if (!uri) {
17961798
return;
17971799
}
@@ -2103,6 +2105,8 @@ export class CommandCenter {
21032105

21042106
@command('git.unstageFile')
21052107
async unstageFile(uri: Uri): Promise<void> {
2108+
uri = uri ?? window.activeTextEditor?.document.uri;
2109+
21062110
if (!uri) {
21072111
return;
21082112
}

0 commit comments

Comments
 (0)