Beispiel #1
0
        protected override void HandleGit(Repository repo, string directory, string relativeDir, string repoUrl)
        {
            ConsoleEx.PrintLine(relativeDir);
            List <Branch> localBranches = repo.Branches
                                          .Where(b => !b.IsRemote)
                                          .OrderByDescending(b => b.IsCurrentRepositoryHead)
                                          .ThenBy(b => b.FriendlyName, StringComparer.OrdinalIgnoreCase)
                                          .ToList();

            foreach (var b in localBranches)
            {
                var branchDisplay = new ColorString("  ");
                if (b.IsCurrentRepositoryHead)
                {
                    branchDisplay.Text("* ");
                }
                else
                {
                    branchDisplay.Text("  ");
                }
                branchDisplay.Green(b.FriendlyName);
                if (b.IsTracking)
                {
                    branchDisplay.Reset("...")
                    .Red(b.TrackedBranch.FriendlyName);
                }
                ConsoleEx.PrintLine(branchDisplay);
            }
        }