OpenHome.Git.Repository.FindOrigin C# (CSharp) Method

FindOrigin() private method

private FindOrigin ( ) : string
return string
        private string FindOrigin()
        {
            var config = new FileStream(Path.Combine(iFolderGit.FullName, "config"), FileMode.Open, FileAccess.Read);

            using (var reader = new StreamReader(config))
            {
                while (true)
                {
                    var line = reader.ReadLine();

                    if (line == null)
                    {
                        throw (new GitOriginNotFoundException());
                    }

                    if (line == "[remote \"origin\"]")
                    {
                        line = reader.ReadLine();

                        if (line == null)
                        {
                            throw (new GitOriginNotFoundException());
                        }

                        if (!line.StartsWith("\turl = "))
                        {
                            throw (new GitOriginNotFoundException());
                        }

                        return (line.Substring(7));
                    }
                }
            }
        }