コード例 #1
0
        public void RewriteMultiPackIndexOnBadVerify()
        {
            this.TestSetup();

            this.gitProcess.SetExpectedCommandResult(
                this.MultiPackIndexWriteCommand,
                () => new GitProcess.Result(string.Empty, string.Empty, GitProcess.Result.SuccessCode));
            this.gitProcess.SetExpectedCommandResult(
                this.MultiPackIndexVerifyCommand,
                () => new GitProcess.Result(string.Empty, string.Empty, GitProcess.Result.GenericFailureCode));
            this.gitProcess.SetExpectedCommandResult(
                this.CommitGraphWriteCommand,
                () => new GitProcess.Result(string.Empty, string.Empty, GitProcess.Result.SuccessCode));
            this.gitProcess.SetExpectedCommandResult(
                this.CommitGraphVerifyCommand,
                () => new GitProcess.Result(string.Empty, string.Empty, GitProcess.Result.SuccessCode));

            PostFetchStep step = new PostFetchStep(this.context, new List<string>() { "pack" }, requireObjectCacheLock: false);
            step.Execute();

            this.tracer.StartActivityTracer.RelatedErrorEvents.Count.ShouldEqual(0);
            this.tracer.StartActivityTracer.RelatedWarningEvents.Count.ShouldEqual(1);

            List<string> commands = this.gitProcess.CommandsRun;

            // Turning off Commit Graph Verify, while we address performance issues
            // commands.Count.ShouldEqual(5);
            commands.Count.ShouldEqual(4);
            commands[0].ShouldEqual(this.MultiPackIndexWriteCommand);
            commands[1].ShouldEqual(this.MultiPackIndexVerifyCommand);
            commands[2].ShouldEqual(this.MultiPackIndexWriteCommand);
            commands[3].ShouldEqual(this.CommitGraphWriteCommand);
            //// commands[4].ShouldEqual(this.CommitGraphVerifyCommand);
        }
コード例 #2
0
        public void WriteGraphWithPacks()
        {
            this.TestSetup();

            this.gitProcess.SetExpectedCommandResult(
                this.CommitGraphWriteCommand,
                () => new GitProcess.Result(string.Empty, string.Empty, GitProcess.Result.SuccessCode));
            this.gitProcess.SetExpectedCommandResult(
                this.CommitGraphVerifyCommand,
                () => new GitProcess.Result(string.Empty, string.Empty, GitProcess.Result.SuccessCode));

            PostFetchStep step = new PostFetchStep(this.context, new List <string>()
            {
                "pack"
            }, requireObjectCacheLock: false);

            step.Execute();

            this.tracer.RelatedInfoEvents.Count.ShouldEqual(0);

            List <string> commands = this.gitProcess.CommandsRun;

            commands.Count.ShouldEqual(2);
            commands[0].ShouldEqual(this.CommitGraphWriteCommand);
            commands[1].ShouldEqual(this.CommitGraphVerifyCommand);
        }
コード例 #3
0
        public void WriteMultiPackIndexNoGraphOnEmptyPacks()
        {
            this.TestSetup();

            this.gitProcess.SetExpectedCommandResult(
                this.MultiPackIndexWriteCommand,
                () => new GitProcess.Result(string.Empty, string.Empty, GitProcess.Result.SuccessCode));
            this.gitProcess.SetExpectedCommandResult(
                this.MultiPackIndexVerifyCommand,
                () => new GitProcess.Result(string.Empty, string.Empty, GitProcess.Result.SuccessCode));

            PostFetchStep step = new PostFetchStep(this.context, new List <string>());

            step.Execute();

            this.tracer.StartActivityTracer.RelatedErrorEvents.Count.ShouldEqual(0);
            this.tracer.StartActivityTracer.RelatedWarningEvents.Count.ShouldEqual(0);
            this.tracer.RelatedInfoEvents.Count.ShouldEqual(1);

            List <string> commands = this.gitProcess.CommandsRun;

            commands.Count.ShouldEqual(2);
            commands[0].ShouldEqual(this.MultiPackIndexWriteCommand);
            commands[1].ShouldEqual(this.MultiPackIndexVerifyCommand);
        }
コード例 #4
0
        public void DontWriteGraphOnEmptyPacks()
        {
            this.TestSetup();

            PostFetchStep step = new PostFetchStep(this.context, new List <string>());

            step.Execute();

            this.tracer.RelatedInfoEvents.Count.ShouldEqual(1);

            List <string> commands = this.gitProcess.CommandsRun;

            commands.Count.ShouldEqual(0);
        }