| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,8 +13,7 @@ var clone = Clone.clone; | |||
| 13 | 13 | */ | |
| 14 | 14 | Clone.clone = function(url, local_path, options) { | |
| 15 | 15 | options = normalizeOptions(options, NodeGit.CloneOptions); | |
| 16 | - | ||
| 17 | - return clone.apply(this, arguments); | ||
| 16 | + return clone.call(this, url, local_path, options); | ||
| 18 | 17 | }; | |
| 19 | 18 | ||
| 20 | 19 | module.exports = Clone; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,6 +41,7 @@ exports.__proto__ = rawApi; | |||
| 41 | 41 | // Import extensions | |
| 42 | 42 | require("./attr"); | |
| 43 | 43 | require("./blob"); | |
| 44 | + require("./clone"); | ||
| 44 | 45 | require("./checkout"); | |
| 45 | 46 | require("./commit"); | |
| 46 | 47 | require("./diff"); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,7 @@ function normalizeOptions(options, Ctor) { | |||
| 8 | 8 | var instance = new Ctor(); | |
| 9 | 9 | ||
| 10 | 10 | if (!options) { | |
| 11 | - return instance; | ||
| 11 | + return null; | ||
| 12 | 12 | } | |
| 13 | 13 | ||
| 14 | 14 | Object.keys(options).forEach(function(key) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,7 +13,6 @@ describe("Clone", function() { | |||
| 13 | 13 | ||
| 14 | 14 | var Repository = require("../../lib/repository"); | |
| 15 | 15 | var Clone = require("../../lib/clone"); | |
| 16 | - var NodeGit = require("../../"); | ||
| 17 | 16 | ||
| 18 | 17 | before(function() { | |
| 19 | 18 | return Promise.all([ | |
@@ -27,9 +26,7 @@ describe("Clone", function() { | |||
| 27 | 26 | ||
| 28 | 27 | it("can clone with http", function() { | |
| 29 | 28 | var url = "http://github.com/nodegit/test.git"; | |
| 30 | - var opts = new NodeGit.CloneOptions(); | ||
| 31 | - | ||
| 32 | - opts.ignoreCertErrors = 1; | ||
| 29 | + var opts = { ignoreCertErrors: 1 }; | ||
| 33 | 30 | ||
| 34 | 31 | return Clone.clone(url, http, opts).then(function(repository) { | |
| 35 | 32 | assert.ok(repository instanceof Repository); | |
@@ -38,9 +35,7 @@ describe("Clone", function() { | |||
| 38 | 35 | ||
| 39 | 36 | it("can clone with https", function() { | |
| 40 | 37 | var url = "https://github.com/nodegit/test.git"; | |
| 41 | - var opts = new NodeGit.CloneOptions(); | ||
| 42 | - | ||
| 43 | - opts.ignoreCertErrors = 1; | ||
| 38 | + var opts = { ignoreCertErrors: 1 }; | ||
| 44 | 39 | ||
| 45 | 40 | return Clone.clone(url, https, opts).then(function(repository) { | |
| 46 | 41 | assert.ok(repository instanceof Repository); | |
@@ -49,9 +44,7 @@ describe("Clone", function() { | |||
| 49 | 44 | ||
| 50 | 45 | it("can clone with ssh", function() { | |
| 51 | 46 | var url = "git@github.com:nodegit/test.git"; | |
| 52 | - var opts = new NodeGit.CloneOptions(); | ||
| 53 | - | ||
| 54 | - opts.ignoreCertErrors = 1; | ||
| 47 | + var opts = { ignoreCertErrors: 1 }; | ||
| 55 | 48 | ||
| 56 | 49 | return Clone.clone(url, ssh, opts).then(function(repository) { | |
| 57 | 50 | assert.ok(repository instanceof Repository); | |
@@ -60,9 +53,7 @@ describe("Clone", function() { | |||
| 60 | 53 | ||
| 61 | 54 | it("can clone with git", function() { | |
| 62 | 55 | var url = "git://github.com/nodegit/test.git"; | |
| 63 | - var opts = new NodeGit.CloneOptions(); | ||
| 64 | - | ||
| 65 | - opts.ignoreCertErrors = 1; | ||
| 56 | + var opts = { ignoreCertErrors: 1 }; | ||
| 66 | 57 | ||
| 67 | 58 | return Clone.clone(url, git, opts).then(function(repository) { | |
| 68 | 59 | assert.ok(repository instanceof Repository); | |
@@ -72,7 +63,7 @@ describe("Clone", function() { | |||
| 72 | 63 | it("can clone with filesystem", function() { | |
| 73 | 64 | var url = "file://" + path.resolve("test/repos/empty"); | |
| 74 | 65 | ||
| 75 | - return Clone.clone(url, file, null).then(function(repository) { | ||
| 66 | + return Clone.clone(url, file).then(function(repository) { | ||
| 76 | 67 | assert.ok(repository instanceof Repository); | |
| 77 | 68 | }); | |
| 78 | 69 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments