Example #1
0
        private static string GetModuleBranch(string path, string noBranchText)
        {
            var branch = VsrModule.GetSelectedBranchFast(path);
            var text   = DetachedHeadParser.IsDetachedHead(branch) ? noBranchText : branch;

            return($"({text})");
        }
Example #2
0
        public string GetCurrentBranchName(string repositoryPath)
        {
            if (!AppSettings.ShowRepoCurrentBranch)
            {
                return(string.Empty);
            }

            string branchName = VsrModule.GetSelectedBranchFast(repositoryPath);

            if (string.IsNullOrWhiteSpace(branchName) || branchName == DetachedHeadParser.DetachedBranch)
            {
                branchName = $"({Strings.NoBranch})";
            }

            return(branchName);
        }