public static RepositoryInfo LoadFromPath( string path, Func<string,RepositoryInfoOptions> optionsBuilder )
{
if( path == null ) throw new ArgumentNullException( nameof( path ) );
if( optionsBuilder == null ) throw new ArgumentNullException( nameof( optionsBuilder ) );
using( var repo = GitHelper.LoadFromPath( path ) )
{
if( repo == null ) return new RepositoryInfo( null, null, null );
return new RepositoryInfo( repo, optionsBuilder( repo.Info.WorkingDirectory ), repo.Info.WorkingDirectory );
}
}