Previously this was only done for ssh based connections, and requires setting an environment variable.
Unified · Split
| @@ -68,7 +68,9 @@ impl SpawnProcessOnDemand { · 67 unmodified lines | ||
| 68 | 68 | path, |
| 69 | 69 | ssh_program: None, |
| 70 | 70 | ssh_args: Vec::new(), |
| 71 | − ssh_env: Vec::new(), | |
| 71 | + ssh_env: (version != Protocol::V1) | |
| 72 | + .then(|| vec![("GIT_PROTOCOL", format!("version={}", version as usize))]) | |
| 73 | + .unwrap_or_default(), | |
| 72 | 74 | child: None, |
| 73 | 75 | connection: None, |
| 74 | 76 | desired_version: version, |