Skip to content
Closed
15 changes: 3 additions & 12 deletions LibGit2Sharp/SubmoduleCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,11 @@ internal SubmoduleCollection(Repository repo)
/// </summary>
/// <param name="name">The name of the Submodule</param>
/// <param name="url">The url of the remote repository</param>
/// <param name="commitOrBranchSpec">The remote branch or commit to checkout</param>
/// <param name="relativePath">The path of the submodule inside of the super repository, if none, name is taken.</param>
/// <param name="useGitLink">Should workdir contain a gitlink to the repo in .git/modules vs. repo directly in workdir.</param>
/// <param name="initiRepository">Should workdir contain a gitlink to the repo in .git/modules vs. repo directly in workdir.</param>
/// <returns></returns>
public Submodule Add(string name, string url, string commitOrBranchSpec, string relativePath = null, bool useGitLink = true,
TagFetchMode tagFetchMode = TagFetchMode.Auto,
ProgressHandler onProgress = null,
CompletionHandler onCompletion = null,
UpdateTipsHandler onUpdateTips = null,
TransferProgressHandler onTransferProgress = null,
Credentials credentials = null,
CheckoutProgressHandler onCheckoutProgress = null,
CheckoutNotificationOptions checkoutNotificationOptions = null)
public Submodule Add(string name, string url, string relativePath, bool useGitLink , Action<Repository> initiRepository)
{
Ensure.ArgumentNotNullOrEmptyString(name, "name");

Expand All @@ -65,8 +57,7 @@ public Submodule Add(string name, string url, string commitOrBranchSpec, string

using (Repository subRep = new Repository(subPath))
{
subRep.Fetch("origin", tagFetchMode, onProgress, onCompletion, onUpdateTips, onTransferProgress, credentials);
subRep.Checkout(commitOrBranchSpec, CheckoutModifiers.None, onCheckoutProgress, checkoutNotificationOptions);
initiRepository(subRep);
}

Proxy.git_submodule_add_finalize(handle);
Expand Down