From a8970119bce765ea4ca18d73fb724e924467607f Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Sun, 10 May 2015 11:51:41 +0200 Subject: Drop optional parameters in Repository.cs --- LibGit2Sharp/Repository.cs | 47 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/LibGit2Sharp/Repository.cs b/LibGit2Sharp/Repository.cs index f7c3b537..5d08d133 100644 --- a/LibGit2Sharp/Repository.cs +++ b/LibGit2Sharp/Repository.cs @@ -37,7 +37,18 @@ namespace LibGit2Sharp private readonly Lazy pathCase; /// - /// Initializes a new instance of the class, providing ooptional behavioral overrides through parameter. + /// Initializes a new instance of the class. + /// For a standard repository, should either point to the ".git" folder or to the working directory. For a bare repository, should directly point to the repository folder. + /// + /// + /// The path to the git repository to open, can be either the path to the git directory (for non-bare repositories this + /// would be the ".git" folder inside the working directory) or the path to the working directory. + /// + public Repository(string path) : this(path, null) + { } + + /// + /// Initializes a new instance of the class, providing optional behavioral overrides through parameter. /// For a standard repository, should either point to the ".git" folder or to the working directory. For a bare repository, should directly point to the repository folder. /// /// @@ -47,7 +58,7 @@ namespace LibGit2Sharp /// /// Overrides to the way a repository is opened. /// - public Repository(string path, RepositoryOptions options = null) + public Repository(string path, RepositoryOptions options) { Ensure.ArgumentNotNullOrEmptyString(path, "path"); @@ -365,13 +376,23 @@ namespace LibGit2Sharp #endregion + /// + /// Initialize a repository at the specified . + /// + /// The path to the working folder when initializing a standard ".git" repository. Otherwise, when initializing a bare repository, the path to the expected location of this later. + /// The path to the created repository. + public static string Init(string path) + { + return Init(path, false); + } + /// /// Initialize a repository at the specified . /// /// The path to the working folder when initializing a standard ".git" repository. Otherwise, when initializing a bare repository, the path to the expected location of this later. /// true to initialize a bare repository. False otherwise, to initialize a standard ".git" repository. /// The path to the created repository. - public static string Init(string path, bool isBare = false) + public static string Init(string path, bool isBare) { Ensure.ArgumentNotNullOrEmptyString(path, "path"); @@ -542,6 +563,24 @@ namespace LibGit2Sharp return discoveredPath.Native; } + /// + /// Clone using default options. + /// + /// This exception is thrown when there + /// is an error is encountered while recursively cloning submodules. The inner exception + /// will contain the original exception. The initially cloned repository would + /// be reported through the + /// property." + /// Exception thrown when the cancelling + /// the clone of the initial repository." + /// URI for the remote repository + /// Local path to clone into + /// The path to the created repository. + public static string Clone(string sourceUrl, string workdirPath) + { + return Clone(sourceUrl, workdirPath, null); + } + /// /// Clone with specified options. /// @@ -557,7 +596,7 @@ namespace LibGit2Sharp /// controlling clone behavior /// The path to the created repository. public static string Clone(string sourceUrl, string workdirPath, - CloneOptions options = null) + CloneOptions options) { Ensure.ArgumentNotNull(sourceUrl, "sourceUrl"); Ensure.ArgumentNotNull(workdirPath, "workdirPath"); -- cgit v1.2.3