private void HandleGetStatusRequest(NamedPipeServer.Connection connection) { NamedPipeMessages.GetStatus.Response response = new NamedPipeMessages.GetStatus.Response(); response.EnlistmentRoot = this.enlistment.EnlistmentRoot; response.LocalCacheRoot = !string.IsNullOrWhiteSpace(this.enlistment.LocalCacheRoot) ? this.enlistment.LocalCacheRoot : this.enlistment.GitObjectsRoot; response.RepoUrl = this.enlistment.RepoUrl; response.CacheServer = this.cacheServer.ToString(); response.LockStatus = this.context?.Repository.GVFSLock != null?this.context.Repository.GVFSLock.GetStatus() : "Unavailable"; response.DiskLayoutVersion = $"{GVFSPlatform.Instance.DiskLayoutUpgrade.Version.CurrentMajorVersion}.{GVFSPlatform.Instance.DiskLayoutUpgrade.Version.CurrentMinorVersion}"; switch (this.currentState) { case MountState.Mounting: response.MountStatus = NamedPipeMessages.GetStatus.Mounting; break; case MountState.Ready: response.MountStatus = NamedPipeMessages.GetStatus.Ready; response.BackgroundOperationCount = this.fileSystemCallbacks.BackgroundOperationCount; break; case MountState.Unmounting: response.MountStatus = NamedPipeMessages.GetStatus.Unmounting; break; case MountState.MountFailed: response.MountStatus = NamedPipeMessages.GetStatus.MountFailed; break; default: response.MountStatus = NamedPipeMessages.UnknownGVFSState; break; } connection.TrySendResponse(response.ToJson()); }
private void HandleGetStatusRequest(NamedPipeServer.Connection connection) { NamedPipeMessages.GetStatus.Response response = new NamedPipeMessages.GetStatus.Response(); response.EnlistmentRoot = this.enlistment.EnlistmentRoot; response.RepoUrl = this.enlistment.RepoUrl; response.ObjectsUrl = this.enlistment.ObjectsEndpointUrl; response.LockStatus = this.gvfsLock != null?this.gvfsLock.GetStatus() : "Unavailable"; response.DiskLayoutVersion = RepoMetadata.GetCurrentDiskLayoutVersion(); switch (this.currentState) { case MountState.Mounting: response.MountStatus = NamedPipeMessages.GetStatus.Mounting; break; case MountState.Ready: response.MountStatus = NamedPipeMessages.GetStatus.Ready; response.BackgroundOperationCount = this.gvfltCallbacks.GetBackgroundOperationCount(); break; case MountState.Unmounting: response.MountStatus = NamedPipeMessages.GetStatus.Unmounting; break; case MountState.MountFailed: response.MountStatus = NamedPipeMessages.GetStatus.MountFailed; break; default: response.MountStatus = NamedPipeMessages.UnknownGVFSState; break; } connection.TrySendResponse(response.ToJson()); }