Skip to content

Commit

Permalink
remove error messages
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 19, 2019
1 parent 22c1eb4 commit 7c4fcb1
Showing 1 changed file with 1 addition and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Scalar.FunctionalTests.FileSystemRunners;
using Scalar.FunctionalTests.Tools;
using Scalar.Tests.Should;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -132,24 +131,17 @@ public void CorruptLooseObjectIsDeleted()

private void ClearAllObjects()
{
Console.Error.WriteLine("ClearAllObjects: start");

this.Enlistment.UnmountScalar();

Console.Error.WriteLine("ClearAllObjects: middle");

// Delete/Move any starting loose objects and packfiles
this.DeleteFiles(this.GetLooseObjectFiles());
this.MovePackFilesToTemp();
this.GetLooseObjectFiles().Count.ShouldEqual(0, "incorrect number of loose objects after setup");
this.CountPackFiles().ShouldEqual(0, "incorrect number of packs after setup");
Console.Error.WriteLine("ClearAllObjects: end");
}

private List<string> GetLooseObjectFiles()
{
Console.Error.WriteLine("GetLooseObjectFiles: start");

List<string> looseObjectFiles = new List<string>();
foreach (string directory in Directory.GetDirectories(this.GitObjectRoot))
{
Expand All @@ -166,8 +158,6 @@ private List<string> GetLooseObjectFiles()

private void DeleteFiles(List<string> filePaths)
{
Console.Error.WriteLine("DeleteFiles: start");

foreach (string filePath in filePaths)
{
File.Delete(filePath);
Expand All @@ -181,8 +171,6 @@ private int CountPackFiles()

private void MovePackFilesToTemp()
{
Console.Error.WriteLine("MovePackFilesToTemp: start");

string[] files = Directory.GetFiles(this.PackRoot);
foreach (string file in files)
{
Expand All @@ -194,15 +182,14 @@ private void MovePackFilesToTemp()
}
else
{
File.SetAttributes(file, FileAttributes.Normal);
File.Delete(file);
}
}
}

private void ExpandOneTempPack(bool copyPackBackToPackDirectory)
{
Console.Error.WriteLine("ExpandOneTempPack: start");

// Find all pack files
string[] packFiles = Directory.GetFiles(this.TempPackRoot, "pack-*.pack");
Assert.Greater(packFiles.Length, 0);
Expand All @@ -216,8 +203,6 @@ private void ExpandOneTempPack(bool copyPackBackToPackDirectory)
// Note this won't work if the object exists in a pack file which is why we had to move them
using (FileStream packFileStream = File.OpenRead(packFile))
{
Console.Error.WriteLine("ExpandOneTempPack: OpenRead to InvokePorcess");

string output = GitProcess.InvokeProcess(
this.Enlistment.RepoRoot,
"unpack-objects",
Expand All @@ -227,8 +212,6 @@ private void ExpandOneTempPack(bool copyPackBackToPackDirectory)

if (copyPackBackToPackDirectory)
{
Console.Error.WriteLine("ExpandOneTempPack: copying to pack dir");

// Copy the pack file back to packs
string packFileName = Path.GetFileName(packFile);
File.Copy(packFile, Path.Combine(this.PackRoot, packFileName));
Expand Down

0 comments on commit 7c4fcb1

Please sign in to comment.