From 3b8d5497318c33881a3ad719cc9f2dd471b32e77 Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Wed, 14 Aug 2019 15:44:29 -0400 Subject: [PATCH] Remove some tests that check prefetch --hydrate Signed-off-by: Derrick Stolee --- .../EnlistmentPerFixture/PrefetchVerbTests.cs | 20 ------------------- Scalar/CommandLine/CloneVerb.cs | 15 +------------- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/Scalar.FunctionalTests/Tests/EnlistmentPerFixture/PrefetchVerbTests.cs b/Scalar.FunctionalTests/Tests/EnlistmentPerFixture/PrefetchVerbTests.cs index 2ccbc785e0..787910f50d 100644 --- a/Scalar.FunctionalTests/Tests/EnlistmentPerFixture/PrefetchVerbTests.cs +++ b/Scalar.FunctionalTests/Tests/EnlistmentPerFixture/PrefetchVerbTests.cs @@ -44,26 +44,6 @@ public void PrefetchByFileExtension() this.ExpectBlobCount(this.Enlistment.Prefetch("--files *.cs;*.csproj"), 208); } - [TestCase, Order(4)] - public void PrefetchByFileExtensionWithHydrate() - { - int expectedCount = 3; - string output = this.Enlistment.Prefetch("--files *.md --hydrate"); - this.ExpectBlobCount(output, expectedCount); - output.ShouldContain("Hydrated files: " + expectedCount); - } - - [TestCase, Order(5)] - public void PrefetchByFilesWithHydrateWhoseObjectsAreAlreadyDownloaded() - { - int expectedCount = 2; - string output = this.Enlistment.Prefetch( - $"--files {Path.Combine("GVFS", "GVFS", "Program.cs")};{Path.Combine("GVFS", "GVFS.FunctionalTests", "GVFS.FunctionalTests.csproj")} --hydrate"); - this.ExpectBlobCount(output, expectedCount); - output.ShouldContain("Hydrated files: " + expectedCount); - output.ShouldContain("Downloaded: 0"); - } - [TestCase, Order(6)] public void PrefetchFolders() { diff --git a/Scalar/CommandLine/CloneVerb.cs b/Scalar/CommandLine/CloneVerb.cs index 09764cfc19..862a065c7c 100644 --- a/Scalar/CommandLine/CloneVerb.cs +++ b/Scalar/CommandLine/CloneVerb.cs @@ -3,15 +3,10 @@ using Scalar.Common.FileSystem; using Scalar.Common.Git; using Scalar.Common.Http; -<<<<<<< HEAD using Scalar.Common.Prefetch; using Scalar.Common.Tracing; using System; using System.Collections.Generic; -======= -using Scalar.Common.Tracing; -using System; ->>>>>>> Initial sparse implementation [PR BUILD] using System.Diagnostics; using System.IO; using System.Linq; @@ -72,8 +67,6 @@ public class CloneVerb : ScalarVerb HelpText = "Use this option to override the path for the local Scalar cache.")] public string LocalCacheRoot { get; set; } -<<<<<<< HEAD -======= [Option( "sparse", Required = false, @@ -81,7 +74,6 @@ public class CloneVerb : ScalarVerb HelpText = "When cloning, create a sparse working directory.")] public bool Sparse { get; set; } ->>>>>>> Initial sparse implementation [PR BUILD] protected override string VerbName { get { return CloneVerbName; } @@ -145,6 +137,7 @@ public override void Execute() { "Branch", this.Branch }, { "LocalCacheRoot", this.LocalCacheRoot }, { "SingleBranch", this.SingleBranch }, + { "Sparse", this.Sparse }, { "NoPrefetch", this.NoPrefetch }, { "Unattended", this.Unattended }, { "IsElevated", ScalarPlatform.Instance.IsElevated() }, @@ -535,7 +528,6 @@ private Result CreateClone( return new Result(installHooksError); } -<<<<<<< HEAD // Place block below in an if statement when sparse clone is available. { BlobPrefetcher prefetcher = new BlobPrefetcher( @@ -558,8 +550,6 @@ private Result CreateClone( hydratedFileCount: out int _); } -======= ->>>>>>> Initial sparse implementation [PR BUILD] GitProcess.Result forceCheckoutResult = git.ForceCheckout(branch); if (forceCheckoutResult.ExitCodeIsFailure && forceCheckoutResult.Errors.IndexOf("unable to read tree") > 0) { @@ -657,8 +647,6 @@ private Result TryInitRepo(ITracer tracer, GitRefs refs, Enlistment enlistmentTo Path.Combine(repoPath, ScalarConstants.DotGit.PackedRefs), refs.ToPackedRefs()); -<<<<<<< HEAD -======= if (this.Sparse) { GitProcess.Result sparseCheckoutResult = GitProcess.SparseCheckoutInit(enlistmentToInit); @@ -670,7 +658,6 @@ private Result TryInitRepo(ITracer tracer, GitRefs refs, Enlistment enlistmentTo } } ->>>>>>> Initial sparse implementation [PR BUILD] return new Result(true); }