diff --git a/Scalar.Common/Git/ScalarGitObjects.cs b/Scalar.Common/Git/ScalarGitObjects.cs index c9857722a8..9806db4fb1 100644 --- a/Scalar.Common/Git/ScalarGitObjects.cs +++ b/Scalar.Common/Git/ScalarGitObjects.cs @@ -1,9 +1,6 @@ using Scalar.Common.Http; -using Scalar.Common.Tracing; using System; using System.Collections.Concurrent; -using System.Collections.Generic; -using System.IO; using System.Net; using System.Threading; @@ -38,16 +35,6 @@ public DownloadAndSaveObjectResult TryDownloadAndSaveObject(string objectId, Req return this.TryDownloadAndSaveObject(objectId, CancellationToken.None, requestSource, retryOnFailure: true); } - public bool TryGetBlobSizeLocally(string sha, out long length) - { - return this.Context.Repository.TryGetBlobLength(sha, out length); - } - - public List GetFileSizes(IEnumerable objectIds, CancellationToken cancellationToken) - { - return this.GitObjectRequestor.QueryForFileSizes(objectIds, cancellationToken); - } - private DownloadAndSaveObjectResult TryDownloadAndSaveObject( string objectId, CancellationToken cancellationToken, diff --git a/Scalar.Common/Prefetch/BlobPrefetcher.cs b/Scalar.Common/Prefetch/BlobPrefetcher.cs index 0533740aee..188834b503 100644 --- a/Scalar.Common/Prefetch/BlobPrefetcher.cs +++ b/Scalar.Common/Prefetch/BlobPrefetcher.cs @@ -35,18 +35,6 @@ public class BlobPrefetcher private FileBasedDictionary lastPrefetchArgs; - public BlobPrefetcher( - ITracer tracer, - Enlistment enlistment, - GitObjectsHttpRequestor objectRequestor, - int chunkSize, - int searchThreadCount, - int downloadThreadCount, - int indexThreadCount) - : this(tracer, enlistment, objectRequestor, null, null, null, chunkSize, searchThreadCount, downloadThreadCount, indexThreadCount) - { - } - public BlobPrefetcher( ITracer tracer, Enlistment enlistment, @@ -202,16 +190,6 @@ public static void AppendToNewlineSeparatedFile(PhysicalFileSystem fileSystem, s } } - /// A specific branch to filter for, or null for all branches returned from info/refs - public virtual void Prefetch(string branchOrCommit, bool isBranch) - { - int matchedBlobCount; - int downloadedBlobCount; - int hydratedFileCount; - - this.PrefetchWithStats(branchOrCommit, isBranch, false, out matchedBlobCount, out downloadedBlobCount, out hydratedFileCount); - } - public void PrefetchWithStats( string branchOrCommit, bool isBranch, diff --git a/Scalar.Common/RepoMetadata.cs b/Scalar.Common/RepoMetadata.cs index 1af3999e7b..0c30b5a6e7 100644 --- a/Scalar.Common/RepoMetadata.cs +++ b/Scalar.Common/RepoMetadata.cs @@ -33,11 +33,6 @@ public string EnlistmentId } } - public string DataFilePath - { - get { return this.repoMetadata.DataFilePath; } - } - public static bool TryInitialize(ITracer tracer, string dotScalarPath, out string error) { return TryInitialize(tracer, new PhysicalFileSystem(), dotScalarPath, out error); @@ -142,36 +137,6 @@ public void SaveCloneMetadata(ITracer tracer, ScalarEnlistment enlistment) }); } - public void SetProjectionInvalid(bool invalid) - { - this.SetInvalid(Keys.ProjectionInvalid, invalid); - } - - public bool GetProjectionInvalid() - { - return this.HasEntry(Keys.ProjectionInvalid); - } - - public void SetPlaceholdersNeedUpdate(bool needUpdate) - { - this.SetInvalid(Keys.PlaceholdersNeedUpdate, needUpdate); - } - - public bool GetPlaceholdersNeedUpdate() - { - return this.HasEntry(Keys.PlaceholdersNeedUpdate); - } - - public void SetProjectionInvalidAndPlaceholdersNeedUpdate() - { - this.repoMetadata.SetValuesAndFlush( - new[] - { - new KeyValuePair(Keys.ProjectionInvalid, bool.TrueString), - new KeyValuePair(Keys.PlaceholdersNeedUpdate, bool.TrueString) - }); - } - public bool TryGetGitObjectsRoot(out string gitObjectsRoot, out string error) { gitObjectsRoot = null; @@ -221,11 +186,6 @@ public bool TryGetLocalCacheRoot(out string localCacheRoot, out string error) return true; } - public void SetLocalCacheRoot(string localCacheRoot) - { - this.repoMetadata.SetValueAndFlush(Keys.LocalCacheRoot, localCacheRoot); - } - public bool TryGetBlobSizesRoot(out string blobSizesRoot, out string error) { blobSizesRoot = null; @@ -267,36 +227,10 @@ private static string CreateNewEnlistmentId(ITracer tracer) return enlistmentId; } - private void SetInvalid(string keyName, bool invalid) - { - if (invalid) - { - this.repoMetadata.SetValueAndFlush(keyName, bool.TrueString); - } - else - { - this.repoMetadata.RemoveAndFlush(keyName); - } - } - - private bool HasEntry(string keyName) - { - string value; - if (this.repoMetadata.TryGetValue(keyName, out value)) - { - return true; - } - - return false; - } - public static class Keys { - public const string ProjectionInvalid = "ProjectionInvalid"; - public const string PlaceholdersInvalid = "PlaceholdersInvalid"; public const string DiskLayoutMajorVersion = "DiskLayoutVersion"; public const string DiskLayoutMinorVersion = "DiskLayoutMinorVersion"; - public const string PlaceholdersNeedUpdate = "PlaceholdersNeedUpdate"; public const string GitObjectsRoot = "GitObjectsRoot"; public const string LocalCacheRoot = "LocalCacheRoot"; public const string BlobSizesRoot = "BlobSizesRoot"; diff --git a/Scalar.Common/ScalarConstants.cs b/Scalar.Common/ScalarConstants.cs index 248445b752..6eaa7807da 100644 --- a/Scalar.Common/ScalarConstants.cs +++ b/Scalar.Common/ScalarConstants.cs @@ -103,11 +103,7 @@ public static class Databases { public const string Name = "databases"; - public static readonly string BackgroundFileSystemTasks = Path.Combine(Name, "BackgroundGitOperations.dat"); - public static readonly string PlaceholderList = Path.Combine(Name, "PlaceholderList.dat"); - public static readonly string ModifiedPaths = Path.Combine(Name, "ModifiedPaths.dat"); public static readonly string RepoMetadata = Path.Combine(Name, "RepoMetadata.dat"); - public static readonly string Scalar = Path.Combine(Name, "Scalar.sqlite"); } public static class GitStatusCache