Example #1
0
        private static string GuessDisplayName(string fullBranchName)
        {
            if (fullBranchName.StartsWith(GitRefHeadPrefix))
            {
                return(fullBranchName.Substring(GitRefHeadPrefix.Length));
            }

            var match = PullRequestPattern.Match(fullBranchName);

            if (match.Success)
            {
                return($"PR {match.Groups[1].Value}");
            }

            return(fullBranchName);
        }
Example #2
0
        public string ExtractDisplayName(string fullBranchName)
        {
            if (fullBranchName.StartsWith(GitRefHeadPrefix, StringComparison.InvariantCulture))
            {
                return(fullBranchName.Substring(GitRefHeadPrefix.Length));
            }

            var match = PullRequestPattern.Match(fullBranchName);

            if (match.Success)
            {
                return($"PR {match.Groups[1].Value}");
            }

            return(fullBranchName);
        }