Skip to content
Open
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
2 changes: 0 additions & 2 deletions GVFS/GVFS.Common/GVFSPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ public static void Register(GVFSPlatform platform)

public abstract Dictionary<string, string> GetPhysicalDiskInfo(string path, bool sizeStatsOnly);

public abstract bool IsConsoleOutputRedirectedToFile();

public abstract bool TryKillProcessTree(int processId, out int exitCode, out string error);

public abstract bool TryGetGVFSEnlistmentRoot(string directory, out string enlistmentRoot, out string errorMessage);
Expand Down
5 changes: 0 additions & 5 deletions GVFS/GVFS.Hooks/HooksPlatform/GVFSHooksPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ public static string GetNamedPipeName(string enlistmentRoot)
return WindowsPlatform.GetNamedPipeNameImplementation(enlistmentRoot);
}

public static bool IsConsoleOutputRedirectedToFile()
{
return WindowsPlatform.IsConsoleOutputRedirectedToFileImplementation();
}

public static bool TryGetGVFSEnlistmentRoot(string directory, out string enlistmentRoot, out string errorMessage)
{
return WindowsPlatform.TryGetGVFSEnlistmentRootImplementation(directory, out enlistmentRoot, out errorMessage);
Expand Down
4 changes: 2 additions & 2 deletions GVFS/GVFS.Hooks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ private static void AcquireGVFSLockForProcess(bool unattended, string[] args, in
fullCommand,
pid,
GVFSHooksPlatform.IsElevated(),
isConsoleOutputRedirectedToFile: GVFSHooksPlatform.IsConsoleOutputRedirectedToFile(),
isConsoleOutputRedirectedToFile: Console.IsOutputRedirected,
checkAvailabilityOnly: checkGvfsLockAvailabilityOnly,
gvfsEnlistmentRoot: null,
gitCommandSessionId: gitCommandSessionId,
Expand All @@ -337,7 +337,7 @@ private static void ReleaseGVFSLock(bool unattended, string[] args, int pid, Nam
fullCommand,
pid,
GVFSHooksPlatform.IsElevated(),
GVFSHooksPlatform.IsConsoleOutputRedirectedToFile(),
Console.IsOutputRedirected,
response =>
{
if (response == null || response.ResponseData == null)
Expand Down
28 changes: 0 additions & 28 deletions GVFS/GVFS.Platform.Windows/WindowsPlatform.Shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Security.Principal;

namespace GVFS.Platform.Windows
Expand All @@ -15,22 +14,6 @@ public partial class WindowsPlatform

private const int StillActive = 259; /* from Win32 STILL_ACTIVE */

private enum StdHandle
{
Stdin = -10,
Stdout = -11,
Stderr = -12
}

private enum FileType : uint
{
Unknown = 0x0000,
Disk = 0x0001,
Char = 0x0002,
Pipe = 0x0003,
Remote = 0x8000,
}

public static bool IsElevatedImplementation()
{
using (WindowsIdentity id = WindowsIdentity.GetCurrent())
Expand Down Expand Up @@ -153,11 +136,6 @@ public static string GetSecureDataRootForGVFSComponentImplementation(string comp
return Path.Combine(GetSecureDataRootForGVFSImplementation(), componentName);
}

public static bool IsConsoleOutputRedirectedToFileImplementation()
{
return FileType.Disk == GetFileType(GetStdHandle(StdHandle.Stdout));
}

public static bool TryGetGVFSEnlistmentRootImplementation(string directory, out string enlistmentRoot, out string errorMessage)
{
enlistmentRoot = null;
Expand All @@ -177,11 +155,5 @@ public static bool TryGetGVFSEnlistmentRootImplementation(string directory, out

return true;
}

[DllImport("kernel32.dll")]
private static extern IntPtr GetStdHandle(StdHandle std);

[DllImport("kernel32.dll")]
private static extern FileType GetFileType(IntPtr hdl);
}
}
5 changes: 0 additions & 5 deletions GVFS/GVFS.Platform.Windows/WindowsPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,6 @@ public override string GetSystemInstallerLogPath()

public override Dictionary<string, string> GetPhysicalDiskInfo(string path, bool sizeStatsOnly) => WindowsPhysicalDiskInfo.GetPhysicalDiskInfo(path, sizeStatsOnly);

public override bool IsConsoleOutputRedirectedToFile()
{
return WindowsPlatform.IsConsoleOutputRedirectedToFileImplementation();
}

public override bool IsGitStatusCacheSupported()
{
return File.Exists(Path.Combine(GVFSPlatform.Instance.GetSecureDataRootForGVFSComponent(GVFSConstants.Service.ServiceName), GVFSConstants.GitStatusCache.EnableGitStatusCacheTokenFile));
Expand Down
5 changes: 0 additions & 5 deletions GVFS/GVFS.UnitTests/Mock/Common/MockPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ public override string GetSystemInstallerLogPath()
return "MockPath";
}

public override bool IsConsoleOutputRedirectedToFile()
{
throw new NotSupportedException();
}

public override bool IsElevated()
{
throw new NotSupportedException();
Expand Down
2 changes: 1 addition & 1 deletion GVFS/GVFS/CommandLine/GVFSVerb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ protected bool ShowStatusWhileRunning(
action,
message,
this.Output,
showSpinner: !this.Unattended && this.Output == Console.Out && !GVFSPlatform.Instance.IsConsoleOutputRedirectedToFile(),
showSpinner: !this.Unattended && this.Output == Console.Out && !Console.IsOutputRedirected,
gvfsLogEnlistmentRoot: gvfsLogEnlistmentRoot,
initialDelayMs: 0);
}
Expand Down
2 changes: 1 addition & 1 deletion GVFS/GVFS/CommandLine/UnmountVerb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ private void AcquireLock(string pipeName, string enlistmentRoot)
"gvfs unmount",
currentProcess.Id,
GVFSPlatform.Instance.IsElevated(),
isConsoleOutputRedirectedToFile: GVFSPlatform.Instance.IsConsoleOutputRedirectedToFile(),
isConsoleOutputRedirectedToFile: Console.IsOutputRedirected,
checkAvailabilityOnly: false,
gvfsEnlistmentRoot: enlistmentRoot,
gitCommandSessionId: string.Empty,
Expand Down
Loading