GitHub PullRequestReviewCommentEvent at 2014-04-23 04:15:27
Repository: libgit2sharp
Actor: jamill
Payload: {"comment":{"url":"https://api.github.com/repos/libgit2/libgit2sharp/pulls/comments/11886375","id":11886375,"diff_hunk":"@@ -33,6 +34,44 @@ internal SubmoduleCollection(Repository repo)\n         }\n \n         /// <summary>\n+        /// Adds a new repository, checkout the selected branch and add it to superproject index  \n+        /// </summary>\n+        /// <remarks>New style: sub-repo goes in &lt;repo-dir&gt;/modules/&lt;name&gt;/ with a\n+        /// gitlink in the sub-repo workdir directory to that repository\n+        /// \n+        /// Old style: sub-repo goes directly into repo/&lt;name&gt;/.git/\n+        /// </remarks>\n+        /// <param name=\"name\">The name of the Submodule</param>\n+        /// <param name=\"url\">The url of the remote repository</param>\n+        /// <param name=\"committish\">A revparse spec for the submodule.</param>\n+        /// <param name=\"relativePath\">The path of the submodule inside of the super repository, if none, name is taken.</param>\n+        /// <param name=\"useGitLink\">Use new style git subrepos or oldstyle.</param>\n+        /// <returns></returns>\n+        public virtual Submodule Add(string name, string url, string committish = null, string relativePath = null, bool useGitLink = true)\n+        {\n+            Ensure.ArgumentNotNullOrEmptyString(name, \"name\");\n+            Ensure.ArgumentNotNullOrEmptyString(url, \"url\");\n+\n+            relativePath = relativePath ?? name;\n+\n+            using (SubmoduleSafeHandle handle = Proxy.git_submodule_add_setup(repo.Handle, url, relativePath, useGitLink))\n+            {\n+                string subPath = Path.Combine(repo.Info.WorkingDirectory, relativePath);\n+\n+                string branch = committish ?? \"refs/remotes/origin/master\";","path":"LibGit2Sharp/SubmoduleCollection.cs","position":36,"original_position":36,"commit_id":"d4d093b068c9d01350bece19939d33674a1f8dcc","original_commit_id":"d4d093b068c9d01350bece19939d33674a1f8dcc","user":{"login":"jamill","id":2045976,"avatar_url":"https://avatars.githubusercontent.com/u/2045976?","gravatar_id":"dd2be90fccc63c838471e8cd35d22754","url":"https://api.github.com/users/jamill","html_url":"https://github.com/jamill","followers_url":"https://api.github.com/users/jamill/followers","following_url":"https://api.github.com/users/jamill/following{/other_user}","gists_url":"https://api.github.com/users/jamill/gists{/gist_id}","starred_url":"https://api.github.com/users/jamill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamill/subscriptions","organizations_url":"https://api.github.com/users/jamill/orgs","repos_url":"https://api.github.com/users/jamill/repos","events_url":"https://api.github.com/users/jamill/events{/privacy}","received_events_url":"https://api.github.com/users/jamill/received_events","type":"User","site_admin":false},"body":"I think we might want to checkout the default branch if no commit is specified. For instance, if I add the libgit2 repository as a submodule, the local `development` branch is checked out.","created_at":"2014-04-23T04:15:27Z","updated_at":"2014-04-23T04:15:27Z","html_url":"https://github.com/libgit2/libgit2sharp/pull/684#discussion_r11886375","pull_request_url":"https://api.github.com/repos/libgit2/libgit2sharp/pulls/684","_links":{"self":{"href":"https://api.github.com/repos/libgit2/libgit2sharp/pulls/comments/11886375"},"html":{"href":"https://github.com/libgit2/libgit2sharp/pull/684#discussion_r11886375"},"pull_request":{"href":"https://api.github.com/repos/libgit2/libgit2sharp/pulls/684"}}}}