File tree 2 files changed +20
-1
lines changed
2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 1
1
# WSLGit Changelog
2
2
3
3
4
- ## [ 0.3.0] - in development
4
+ ## [ 0.3.0] - 2017-11-08
5
5
6
6
### Added
7
7
8
8
- Add proper license (MIT).
9
9
10
+ ### Fixed
11
+
12
+ - Git waiting for input when called from VS Code to check if ` git --version `
13
+ works.
14
+
10
15
11
16
## [ 0.2.0] - 2017-07-27
12
17
Original file line number Diff line number Diff line change @@ -66,10 +66,24 @@ fn main() {
66
66
. map ( translate_path_to_unix)
67
67
. map ( shell_escape) ) ;
68
68
let git_cmd = git_args. join ( " " ) ;
69
+ let stdin_mode = if git_cmd. ends_with ( "--version" ) {
70
+ // For some reason, the git subprocess seems to hang, waiting for
71
+ // input, when VS Code 1.17.2 tries to detect if `git --version` works
72
+ // on Windows 10 1709 (specifically, in `findSpecificGit` in the
73
+ // VS Code source file `extensions/git/src/git.ts`).
74
+ // To workaround this, we only pass stdin to the git subprocess
75
+ // for all other commands, but not for the initial `--version` check.
76
+ // Stdin is needed for example when commiting, where the commit
77
+ // message is passed on stdin.
78
+ Stdio :: null ( )
79
+ } else {
80
+ Stdio :: inherit ( )
81
+ } ;
69
82
let git_proc = Command :: new ( "bash" )
70
83
. arg ( "-i" )
71
84
. arg ( "-c" )
72
85
. arg ( & git_cmd)
86
+ . stdin ( stdin_mode)
73
87
. stdout ( Stdio :: piped ( ) )
74
88
. spawn ( )
75
89
. expect ( & format ! ( "Failed to execute command '{}'" , & git_cmd) ) ;
You can’t perform that action at this time.
0 commit comments