public static LoadFromPath ( string path, RepositoryInfoOptions>.Func |
||
path | string | The path to lookup. |
optionsBuilder | RepositoryInfoOptions>.Func | Function that can create a |
Résultat |
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)); }
/// <summary> /// Creates a new <see cref="SimpleRepositoryInfo"/> based on a path (that can be below the folder with the '.git' sub folder). /// </summary> /// <param name="path">The path to lookup.</param> /// <param name="logger">Logger that will be used.</param> /// <param name="optionsChecker"> /// Optional action that accepts the logger, a boolean that is true if a RepositoryInfo.xml has been /// found, and the <see cref="RepositoryInfoOptions"/> that will be used. /// </param> /// <returns>An immutable SimpleRepositoryInfo instance.</returns> static public SimpleRepositoryInfo LoadFromPath(ILogger logger, string path, Action <ILogger, bool, RepositoryInfoOptions> optionsChecker = null) { if (logger == null) { throw new ArgumentNullException(nameof(logger)); } RepositoryInfo info = RepositoryInfo.LoadFromPath(path, gitPath => { string optionFile = Path.Combine(gitPath, "RepositoryInfo.xml"); bool fileExists = File.Exists(optionFile); var options = fileExists ? RepositoryInfoOptions.Read(optionFile) : new RepositoryInfoOptions(); optionsChecker?.Invoke(logger, fileExists, options); return(options); }); return(new SimpleRepositoryInfo(logger, info)); }
public RepositoryInfo GetRepositoryInfo(string commitSha, TagsOverride tags = null) { return(RepositoryInfo.LoadFromPath(Path, new RepositoryInfoOptions { StartingCommitSha = commitSha, OverriddenTags = tags != null ? tags.Overrides : null })); }
public RepositoryInfo GetRepositoryInfo(RepositoryInfoOptions options = null) { return(RepositoryInfo.LoadFromPath(Path, options)); }