コード例 #1
0
 protected void ValidateGitCommand(string command, params object[] args)
 {
     GitHelpers.ValidateGitCommand(
         this.Enlistment,
         this.ControlGitRepo,
         command,
         args);
 }
コード例 #2
0
 private void ValidateGitCommand(ControlGitRepo controlGitRepo, string command, params object[] args)
 {
     GitHelpers.ValidateGitCommand(
         this.Enlistment,
         controlGitRepo,
         command,
         args);
 }
コード例 #3
0
        /* We are using the following method for these scenarios
         * 1. Some commands compute a new commit sha, which is dependent on time and therefore
         *    won't match what is in the control repo.  For those commands, we just ensure that
         *    the errors match what we expect, but we skip comparing the output
         * 2. Using the sparse-checkout feature git will error out before checking the untracked files
         *    so the control repo will show the untracked files as being overwritten while the GVFS
         *    repo which is using the sparse-checkout will not.
         * 3. GVFS is returning not found for files that are outside the sparse-checkout and there
         *    are cases when git will delete these files during a merge outputting that it removed them
         *    which the GVFS repo did not have to remove so the message is missing that output.
         */
        protected void RunGitCommand(string command, bool ignoreErrors = false, bool checkStatus = true)
        {
            string controlRepoRoot = this.ControlGitRepo.RootPath;
            string gvfsRepoRoot    = this.Enlistment.RepoRoot;

            ProcessResult expectedResult = GitProcess.InvokeProcess(controlRepoRoot, command);
            ProcessResult actualResult   = GitHelpers.InvokeGitAgainstGVFSRepo(gvfsRepoRoot, command);

            if (!ignoreErrors)
            {
                GitHelpers.ErrorsShouldMatch(command, expectedResult, actualResult);
            }

            if (command != "status" && checkStatus)
            {
                GitHelpers.ValidateGitCommand(command + "-status", this.Enlistment, this.ControlGitRepo, "status");
            }
        }