89 references to GitCli
Infrastructure.Tests (89)
TestTriggerMap\GraphAffectedProjectsTests.cs (1)
475private string Git(params string[] args) => GitCli.Run(_workspace.Path, args);
TestTriggerMap\PrComparisonBaseTests.cs (86)
33GitCli.Run(workspace.Path, "clone", "--no-local", new Uri(repo).AbsoluteUri, checkout); 34Assert.Equal("false", GitCli.Run(checkout, "rev-parse", "--is-shallow-repository")); 42Assert.Equal(merge, GitCli.Run(checkout, "rev-parse", "HEAD")); 61expectedMerge = GitCli.Run(workspace.Path, "rev-parse", $"{head}^"); 62GitCli.Run(workspace.Path, "checkout", "--detach", expectedMerge); 66expectedMerge = GitCli.Run(workspace.Path, "commit-tree", $"{merge}^{{tree}}", 68GitCli.Run(workspace.Path, "checkout", "--detach", expectedMerge); 87GitCli.Run(repo, "init", "-b", "main"); 88GitCli.Run(repo, "config", "user.email", "test@example.invalid"); 89GitCli.Run(repo, "config", "user.name", "Test"); 92GitCli.Run(repo, "add", "."); 93GitCli.Run(repo, "commit", "-m", "Root"); 94var root = GitCli.Run(repo, "rev-parse", "HEAD"); 100GitCli.Run(repo, "commit", "-am", "Production change"); 101var commonAncestor = GitCli.Run(repo, "rev-parse", "HEAD"); 102GitCli.Run(repo, "branch", "topic"); 106GitCli.Run(repo, "checkout", "-b", $"{side}-side", root); 110GitCli.Run(repo, "checkout", "main"); 115GitCli.Run(repo, "merge", "--no-ff", "main-side", "-m", "Merge main docs"); 116var currentBase = GitCli.Run(repo, "rev-parse", "HEAD"); 117GitCli.Run(repo, "checkout", "topic"); 123GitCli.Run(repo, "commit", "-am", "Revert production change"); 124GitCli.Run(repo, "merge", "--no-ff", "pr-side", "-m", "Merge PR docs"); 125var head = GitCli.Run(repo, "rev-parse", "HEAD"); 126GitCli.Run(repo, "checkout", "main"); 127GitCli.Run(repo, "merge", "--no-ff", "topic", "-m", "Synthetic merge"); 128var merge = GitCli.Run(repo, "rev-parse", "HEAD"); 129Assert.Equal(commonAncestor, GitCli.Run(repo, "merge-base", "--all", currentBase, head)); 134GitCli.Run(workspace.Path, "clone", "--depth=1", "--no-local", new Uri(repo).AbsoluteUri, checkout); 137GitCli.Run(checkout, "fetch", "--no-tags", "--depth=4", "origin", currentBase, head); 138Assert.Equal(root, GitCli.Run(checkout, "merge-base", currentBase, head)); 147Assert.Equal("true", GitCli.Run(checkout, "rev-parse", "--is-shallow-repository")); 149GitCli.Run(checkout, "fetch", "--no-tags", "--unshallow", "origin"); 159Assert.Equal(commonAncestor, GitCli.Run(checkout, "merge-base", "--all", currentBase, head)); 160Assert.Equal("false", GitCli.Run(checkout, "rev-parse", "--is-shallow-repository")); 161Assert.Equal(merge, GitCli.Run(checkout, "rev-parse", "HEAD")); 172GitCli.Run(workspace.Path, "clone", "--depth=1", "--no-local", new Uri(repo).AbsoluteUri, checkout); 173GitCli.Run(checkout, "remote", "remove", "origin"); 180Assert.Equal("true", GitCli.Run(checkout, "rev-parse", "--is-shallow-repository")); 189GitCli.Run(repo, "init", "-b", "main"); 190GitCli.Run(repo, "config", "user.email", "test@example.invalid"); 191GitCli.Run(repo, "config", "user.name", "Test"); 194GitCli.Run(repo, "add", "."); 195GitCli.Run(repo, "commit", "-m", "Root"); 196var root = GitCli.Run(repo, "rev-parse", "HEAD"); 198GitCli.Run(repo, "commit", "-am", "Production change"); 199var productionAncestor = GitCli.Run(repo, "rev-parse", "HEAD"); 200GitCli.Run(repo, "checkout", "-b", "topic", root); 204GitCli.Run(repo, "merge", "--no-ff", "-s", "ours", productionAncestor, "-m", "Discard production change"); 205var head = GitCli.Run(repo, "rev-parse", "HEAD"); 206GitCli.Run(repo, "checkout", "main"); 207GitCli.Run(repo, "merge", "--no-ff", docsAncestor, "-m", "Merge docs"); 208var currentBase = GitCli.Run(repo, "rev-parse", "HEAD"); 211GitCli.Run(repo, "merge-base", "--all", currentBase, head).Split('\n').Order(StringComparer.Ordinal)); 212GitCli.Run(repo, "merge", "--no-ff", "-s", "ours", "topic", "-m", "Synthetic merge"); 213var merge = GitCli.Run(repo, "rev-parse", "HEAD"); 227GitCli.Run(workspace.Path, "checkout", "--detach", head); 242GitCli.Run(workspace.Path, "checkout", "--orphan", "unrelated"); 243GitCli.Run(workspace.Path, "rm", "-rf", "."); 245GitCli.Run(workspace.Path, "checkout", "main"); 246GitCli.Run(workspace.Path, "merge", "--no-ff", "--allow-unrelated-histories", "unrelated", "-m", "Synthetic merge"); 247var merge = GitCli.Run(workspace.Path, "rev-parse", "HEAD"); 248GitCli.Run(workspace.Path, "remote", "add", "origin", workspace.Path); 263GitCli.Run(workspace.Path, "remote", "add", "origin", workspace.Path); 278GitCli.Run(workspace.Path, "checkout", "topic"); 279GitCli.Run(workspace.Path, "mv", "root.txt", "renamed.txt"); 280GitCli.Run(workspace.Path, "commit", "-m", "Rename PR file"); 281var head = GitCli.Run(workspace.Path, "rev-parse", "HEAD"); 282GitCli.Run(workspace.Path, "checkout", "main"); 283GitCli.Run(workspace.Path, "merge", "--no-ff", "topic", "-m", "Synthetic merge"); 284var merge = GitCli.Run(workspace.Path, "rev-parse", "HEAD"); 306GitCli.Run(repo, "init", "-b", "main"); 307GitCli.Run(repo, "config", "user.email", "test@example.invalid"); 308GitCli.Run(repo, "config", "user.name", "Test"); 310GitCli.Run(repo, "checkout", "-b", "topic"); 312GitCli.Run(repo, "checkout", "main"); 314GitCli.Run(repo, "checkout", "topic"); 317GitCli.Run(repo, "merge", "--no-ff", "main", "-m", "Update topic"); 319var head = GitCli.Run(repo, "rev-parse", "HEAD"); 320GitCli.Run(repo, "checkout", "main"); 321GitCli.Run(repo, "merge", "--no-ff", "topic", "-m", "Synthetic merge"); 323return (oldBase, currentBase, head, GitCli.Run(repo, "rev-parse", "HEAD")); 329GitCli.Run(repo, "add", "--", path); 330GitCli.Run(repo, "commit", "-m", $"Add {path}"); 332return GitCli.Run(repo, "rev-parse", "HEAD"); 336=> GitCli.Run(repo, "diff", "--name-only", "--no-renames", $"{from}...{to}")
TestTriggerMap\SelectTestsCliTests.cs (1)
1441private static string RunGit(string repoRoot, params string[] args) => GitCli.Run(repoRoot, args);
TestTriggerMap\SelectTestsLayer1IntegrationTests.cs (1)
402public string Git(params string[] args) => GitCli.Run(_workspace.Path, args);