Skip to content

Commit d30b669

Browse files
authored
Merge pull request #627 from jamill/git_for_vs2019
Configure Visual Studio 2019 to use expected version of Git
2 parents 96eaf4e + 6ce646e commit d30b669

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

GVFS/GVFS.Platform.Windows/WindowsPlatform.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,11 @@ public override string GetNamedPipeName(string enlistmentRoot)
201201
public override void ConfigureVisualStudio(string gitBinPath, ITracer tracer)
202202
{
203203
const string GitBinPathEnd = "\\cmd\\git.exe";
204-
const string GitVSRegistryKeyName = "HKEY_CURRENT_USER\\Software\\Microsoft\\VSCommon\\15.0\\TeamFoundation\\GitSourceControl";
204+
string[] gitVSRegistryKeyNames =
205+
{
206+
"HKEY_CURRENT_USER\\Software\\Microsoft\\VSCommon\\15.0\\TeamFoundation\\GitSourceControl",
207+
"HKEY_CURRENT_USER\\Software\\Microsoft\\VSCommon\\16.0\\TeamFoundation\\GitSourceControl"
208+
};
205209
const string GitVSRegistryValueName = "GitPath";
206210

207211
if (!gitBinPath.EndsWith(GitBinPathEnd))
@@ -214,7 +218,10 @@ public override void ConfigureVisualStudio(string gitBinPath, ITracer tracer)
214218
}
215219

216220
string regKeyValue = gitBinPath.Substring(0, gitBinPath.Length - GitBinPathEnd.Length);
217-
Registry.SetValue(GitVSRegistryKeyName, GitVSRegistryValueName, regKeyValue);
221+
foreach (string registryKeyName in gitVSRegistryKeyNames)
222+
{
223+
Registry.SetValue(registryKeyName, GitVSRegistryValueName, regKeyValue);
224+
}
218225
}
219226

220227
public override bool TryGetGVFSHooksPathAndVersion(out string hooksPath, out string hooksVersion, out string error)

0 commit comments

Comments
 (0)