| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,6 +16,10 @@ describe("Config", function() { | |||
| 16 | 16 | it("can get and set a global value", function() { | |
| 17 | 17 | var savedUserName; | |
| 18 | 18 | ||
| 19 | + function finallyFn() { | ||
| 20 | + return exec("git config --global user.name \"" + savedUserName + "\""); | ||
| 21 | + } | ||
| 22 | + | ||
| 19 | 23 | return exec("git config --global user.name") | |
| 20 | 24 | .then(function(userName) { | |
| 21 | 25 | savedUserName = userName.trim(); | |
@@ -32,14 +36,18 @@ describe("Config", function() { | |||
| 32 | 36 | .then(function(userNameFromNodeGit) { | |
| 33 | 37 | assert.equal(savedUserName + "-test", userNameFromNodeGit); | |
| 34 | 38 | }) | |
| 35 | - .finally(function() { | ||
| 36 | - return exec("git config --global user.name \"" + savedUserName + "\""); | ||
| 37 | - }); | ||
| 39 | + .then(finallyFn, finallyFn); | ||
| 38 | 40 | }); | |
| 39 | 41 | ||
| 40 | 42 | it("can get and set a repo config value", function() { | |
| 41 | 43 | var savedUserName; | |
| 42 | 44 | ||
| 45 | + function finallyFn() { | ||
| 46 | + return exec("git config user.name \"" + savedUserName + "\"", { | ||
| 47 | + cwd: reposPath | ||
| 48 | + }); | ||
| 49 | + } | ||
| 50 | + | ||
| 43 | 51 | return exec("git config user.name", { | |
| 44 | 52 | cwd: reposPath | |
| 45 | 53 | }) | |
@@ -62,10 +70,6 @@ describe("Config", function() { | |||
| 62 | 70 | .then(function(userNameFromNodeGit) { | |
| 63 | 71 | assert.equal(savedUserName + "-test", userNameFromNodeGit); | |
| 64 | 72 | }) | |
| 65 | - .finally(function() { | ||
| 66 | - return exec("git config user.name \"" + savedUserName + "\"", { | ||
| 67 | - cwd: reposPath | ||
| 68 | - }); | ||
| 69 | - }); | ||
| 73 | + .then(finallyFn, finallyFn); | ||
| 70 | 74 | }); | |
| 71 | 75 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,10 +15,13 @@ describe("Remote", function() { | |||
| 15 | 15 | function removeOrigins(repo) { | |
| 16 | 16 | return repo.getRemotes() | |
| 17 | 17 | .then(function(remotes) { | |
| 18 | + console.log(remotes); | ||
| 18 | 19 | var promises = []; | |
| 19 | 20 | ||
| 20 | 21 | remotes.forEach(function(remote) { | |
| 21 | - promises.push(Remote.delete(repo, remote.name())); | ||
| 22 | + if (remote !== "origin") { | ||
| 23 | + promises.push(Remote.delete(repo, remote)); | ||
| 24 | + } | ||
| 22 | 25 | }); | |
| 23 | 26 | ||
| 24 | 27 | return Promise.all(promises); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments