SimpleGitVersion.RepositoryInfo.LoadFromPath C# (CSharp) Метод

LoadFromPath() публичный статический Метод

Creates a new RepositoryInfo based on a path (that can be below the folder with the '.git' sub folder) and a function that can create a RepositoryInfoOptions from the actual Git repository path.
public static LoadFromPath ( string path, RepositoryInfoOptions>.Func optionsBuilder ) : RepositoryInfo
path string The path to lookup.
optionsBuilder RepositoryInfoOptions>.Func Function that can create a from the Git working directory (the Solution folder).
Результат RepositoryInfo
        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 );
            }
        }

Same methods

RepositoryInfo::LoadFromPath ( string path, SimpleGitVersion.RepositoryInfoOptions options = null ) : RepositoryInfo

Usage Example

 public static RepositoryInfo GetRepositoryInfo(this ICakeContext context, RepositoryInfoOptions options = null)
 {
     if (context == null)
     {
         throw new ArgumentNullException("context");
     }
     return(RepositoryInfo.LoadFromPath(context.Environment.WorkingDirectory.FullPath, options));
 }
All Usage Examples Of SimpleGitVersion.RepositoryInfo::LoadFromPath