Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UntrackedCache: enable based on platform #89

Merged
merged 1 commit into from
Aug 27, 2019
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
1 change: 1 addition & 0 deletions Scalar.Common/FileSystem/IPlatformFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Scalar.Common.FileSystem
public interface IPlatformFileSystem
{
bool SupportsFileMode { get; }
bool SupportsUntrackedCache { get; }
void FlushFileBuffers(string path);
void MoveAndOverwriteFile(string sourceFileName, string destinationFilename);
bool TryGetNormalizedPath(string path, out string normalizedPath, out string errorMessage);
Expand Down
2 changes: 2 additions & 0 deletions Scalar.Platform.POSIX/POSIXFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public enum OpenFlags

public bool SupportsFileMode { get; } = true;

public bool SupportsUntrackedCache { get; } = true;

public void FlushFileBuffers(string path)
{
// TODO(#1057): Use native API to flush file
Expand Down
2 changes: 2 additions & 0 deletions Scalar.Platform.Windows/WindowsFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public partial class WindowsFileSystem : IPlatformFileSystem
{
public bool SupportsFileMode { get; } = false;

public bool SupportsUntrackedCache { get; } = false;

/// <summary>
/// Adds a new FileSystemAccessRule granting read (and optionally modify) access for all users.
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions Scalar.UnitTests/Mock/FileSystem/MockPlatformFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public class MockPlatformFileSystem : IPlatformFileSystem
{
public bool SupportsFileMode { get; } = true;

public bool SupportsUntrackedCache { get; } = true;

public void FlushFileBuffers(string path)
{
throw new NotSupportedException();
Expand Down
2 changes: 1 addition & 1 deletion Scalar/CommandLine/ScalarVerb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public static bool TrySetRequiredGitConfigSettings(Enlistment enlistment)
{ "core.multiPackIndex", "true" },
{ "core.preloadIndex", "true" },
{ "core.safecrlf", "false" },
{ "core.untrackedCache", "false" },
{ "core.untrackedCache", ScalarPlatform.Instance.FileSystem.SupportsUntrackedCache ? "true" : "false" },
{ "core.repositoryformatversion", "0" },
{ "core.filemode", ScalarPlatform.Instance.FileSystem.SupportsFileMode ? "true" : "false" },
{ GitConfigSetting.CoreVirtualizeObjectsName, "true" },
Expand Down