Skip to content

Commit

Permalink
Remove some tests that check prefetch --hydrate
Browse files Browse the repository at this point in the history
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
  • Loading branch information
derrickstolee committed Aug 22, 2019
1 parent f27bf46 commit 3b8d549
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
15 changes: 1 addition & 14 deletions Scalar/CommandLine/CloneVerb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -72,16 +67,13 @@ 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,
Default = true,
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; }
Expand Down Expand Up @@ -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() },
Expand Down Expand Up @@ -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(
Expand All @@ -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)
{
Expand Down Expand Up @@ -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);
Expand All @@ -670,7 +658,6 @@ private Result TryInitRepo(ITracer tracer, GitRefs refs, Enlistment enlistmentTo
}
}

>>>>>>> Initial sparse implementation [PR BUILD]
return new Result(true);
}

Expand Down

0 comments on commit 3b8d549

Please sign in to comment.