TicGit.Net.Base.FindRepo C# (CSharp) Method

FindRepo() public method

public FindRepo ( string dir ) : string
dir string
return string
        public string FindRepo(string dir)
        {
            var full = System.IO.Path.GetFullPath(dir);
            if (string.IsNullOrEmpty(System.Environment.GetEnvironmentVariable("GIT_WORKING_DIR")))
            {
                while (true)
                {
                    if (new DirectoryInfo(Path.Combine(full, ".git")).Exists)
                        return full;
                    full = Path.GetDirectoryName(full);
                    if (Path.GetPathRoot(full) == full)
                        throw new RepositoryNotFoundException();
                }
            }
            return Directory.GetCurrentDirectory();
        }