GitCommands.GitCommands.GetRemoteName C# (CSharp) Method

GetRemoteName() public static method

public static GetRemoteName ( string completeName, IEnumerable remotes ) : string
completeName string
remotes IEnumerable
return string
        public static string GetRemoteName(string completeName, IEnumerable<string> remotes)
        {
            string trimmedName = completeName.StartsWith("refs/remotes/") ? completeName.Substring(13) : completeName;

            foreach (string remote in remotes)
            {
                if (trimmedName.StartsWith(string.Concat(remote, "/")))
                    return remote;
            }

            return string.Empty;
        }
GitCommands