From 2e4856aae5f6b45c15c23c8ba3b92db3875127d5 Mon Sep 17 00:00:00 2001 From: Matthew Chase Whittemore Date: Sat, 9 Nov 2013 19:32:41 -0500 Subject: [PATCH 1/3] adding org abilities to forking of repos --- github.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/github.js b/github.js index ab94104d..d3864851 100644 --- a/github.js +++ b/github.js @@ -446,8 +446,15 @@ // Fork repository // ------- - this.fork = function(cb) { - _request("POST", repoPath + "/forks", null, cb); + this.fork = function(org, cb) { + if(typeof org =="function"){ + cb = org; + org = null; + } + else{ + org = {organization: org}; + } + _request("POST", repoPath + "/forks", org, cb); }; // Branch repository From baf70be401f697299d499a69150160df72b8f608 Mon Sep 17 00:00:00 2001 From: Matthew Chase Whittemore Date: Sat, 9 Nov 2013 20:58:58 -0500 Subject: [PATCH 2/3] adding explantion to readme --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 39fea264..e444f54b 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,12 @@ Fork repository. This operation runs asynchronously. You may want to poll for `r repo.fork(function(err) {}); ``` +Fork repository to an organzation. + +```js +repo.fork("your-org-name", function(err){}); +``` + Create new branch for repo. You can omit oldBranchName to default to "master". ```js From 5b09c24ddd0e7fb93d3bfed1632dafe35b26d6d5 Mon Sep 17 00:00:00 2001 From: Matthew Chase Whittemore Date: Sun, 10 Nov 2013 15:15:17 -0500 Subject: [PATCH 3/3] adding in edit repo --- github.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/github.js b/github.js index d3864851..27fb9365 100644 --- a/github.js +++ b/github.js @@ -252,6 +252,13 @@ _request("DELETE", repoPath + "/git/refs/"+ref, options, cb); }; + // Edit a repo + // ------- + + this.editRepo = function(options, cb) { + _request("PATCH", repoPath, options, cb); + }; + // Create a repo // -------