Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion GVFS/GVFS.Common/ProcessHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,16 @@ public static string GetCurrentProcessVersion()

public static bool IsDevelopmentVersion()
{
Version currentVersion = new Version(ProcessHelper.GetCurrentProcessVersion());
string version = ProcessHelper.GetCurrentProcessVersion();
/* When debugging local version with VS, the version will include +{commitId} suffix,
* which is not valid for Version class. */
var plusIndex = version.IndexOf('+');
if (plusIndex >= 0)
{
version = version.Substring(0, plusIndex);
}

Version currentVersion = new Version(version);

return currentVersion.Major == 0;
}
Expand Down
8 changes: 7 additions & 1 deletion GVFS/GVFS/CommandLine/GVFSVerb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,14 @@ private bool TryValidateGVFSVersion(GVFSEnlistment enlistment, ITracer tracer, S

using (ITracer activity = tracer.StartActivity("ValidateGVFSVersion", EventLevel.Informational))
{
Version currentVersion = new Version(ProcessHelper.GetCurrentProcessVersion());
if (ProcessHelper.IsDevelopmentVersion())
{
/* Development Version will start with 0 and include a "+{commitID}" suffix
* so it won't ever be valid, but it needs to be able to run so we can test it. */
return true;
}

Version currentVersion = new Version(ProcessHelper.GetCurrentProcessVersion());
IEnumerable<ServerGVFSConfig.VersionRange> allowedGvfsClientVersions =
config != null
? config.AllowedGVFSClientVersions
Expand Down