Skip to content

Commit 2e3f21a

Browse files
committed
fix config.getString and tests
1 parent 93d7e57 commit 2e3f21a

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

lib/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ var NodeGit = require("../");
33
var Config = NodeGit.Config;
44

55
// Backwards compatibility.
6-
Config.getString = function() {
7-
return Config.getStringBuf.apply(this, arguments);
6+
Config.prototype.getString = function() {
7+
return this.getStringBuf.apply(this, arguments);
88
};

test/tests/config.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ describe("Config", function() {
3636
.then(function(userNameFromNodeGit) {
3737
assert.equal(savedUserName + "-test", userNameFromNodeGit);
3838
})
39-
.then(finallyFn, finallyFn);
39+
.then(finallyFn)
40+
.catch(function(e) {
41+
return finallyFn()
42+
.then(function() {
43+
throw e;
44+
});
45+
});
4046
});
4147

4248
it("can get and set a repo config value", function() {
@@ -70,6 +76,12 @@ describe("Config", function() {
7076
.then(function(userNameFromNodeGit) {
7177
assert.equal(savedUserName + "-test", userNameFromNodeGit);
7278
})
73-
.then(finallyFn, finallyFn);
79+
.then(finallyFn)
80+
.catch(function(e) {
81+
return finallyFn()
82+
.then(function() {
83+
throw e;
84+
});
85+
});
7486
});
7587
});

0 commit comments

Comments
 (0)