Example #1
0
        public void MountSetsCoreHooksPath()
        {
            try
            {
                GVFSHelpers.RegisterForOfflineIO();

                this.Enlistment.UnmountGVFS();

                GitProcess.Invoke(this.Enlistment.RepoRoot, "config --unset core.hookspath");
                string.IsNullOrWhiteSpace(
                    GitProcess.Invoke(this.Enlistment.RepoRoot, "config core.hookspath"))
                .ShouldBeTrue();

                this.Enlistment.MountGVFS();
                string expectedHooksPath = this.Enlistment.GetDotGitPath("hooks");
                expectedHooksPath = GitHelpers.ConvertPathToGitFormat(expectedHooksPath);

                GitProcess.Invoke(
                    this.Enlistment.RepoRoot, "config core.hookspath")
                .Trim('\n')
                .ShouldEqual(expectedHooksPath);
            }
            finally
            {
                GVFSHelpers.UnregisterForOfflineIO();
            }
        }
        public void CanReadFileAfterGitRmDryRun()
        {
            this.ValidateGitCommand("status");

            // Validate that Scripts\RunUnitTests.bad is not on disk at all
            string filePath = Path.Combine("Scripts", "RunUnitTests.bat");

            this.Enlistment.UnmountGVFS();
            this.Enlistment.GetVirtualPathTo(filePath).ShouldNotExistOnDisk(this.FileSystem);
            this.Enlistment.MountGVFS();

            this.ValidateGitCommand("rm --dry-run " + GitHelpers.ConvertPathToGitFormat(filePath));
            this.FileContentsShouldMatch(filePath);
        }
        public void CanReadFileAfterHashObject()
        {
            this.ValidateGitCommand("status");

            // Validate that Scripts\RunUnitTests.bad is not on disk at all
            string filePath = Path.Combine("Scripts", "RunUnitTests.bat");

            this.Enlistment.UnmountGVFS();
            this.Enlistment.GetVirtualPathTo(filePath).ShouldNotExistOnDisk(this.FileSystem);
            this.Enlistment.MountGVFS();

            // TODO 1087312: Fix 'git hash-oject' so that it works for files that aren't on disk yet
            GitHelpers.InvokeGitAgainstGVFSRepo(
                this.Enlistment.RepoRoot,
                "hash-object " + GitHelpers.ConvertPathToGitFormat(filePath));

            this.FileContentsShouldMatch(filePath);
        }
Example #4
0
        public void MountSetsCoreHooksPath()
        {
            this.Enlistment.UnmountGVFS();

            GitProcess.Invoke(this.Enlistment.RepoRoot, "config --unset core.hookspath");
            string.IsNullOrWhiteSpace(
                GitProcess.Invoke(this.Enlistment.RepoRoot, "config core.hookspath"))
            .ShouldBeTrue();

            this.Enlistment.MountGVFS();
            string expectedHooksPath = Path.Combine(this.Enlistment.RepoRoot, ".git", "hooks");

            expectedHooksPath = GitHelpers.ConvertPathToGitFormat(expectedHooksPath);

            GitProcess.Invoke(
                this.Enlistment.RepoRoot, "config core.hookspath")
            .Trim('\n')
            .ShouldEqual(expectedHooksPath);
        }