Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add test for Tree#createUpdated
  • Loading branch information
rafaelgieschke committed May 10, 2017
commit 8dae43af3b6941d99018693c44caa5146355e302
18 changes: 18 additions & 0 deletions test/tests/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,24 @@ describe("Tree", function() {
}).done(done);
});

it("updates a tree", function () {
var repo = this.existingRepo;
var update = new NodeGit.TreeUpdate();
update.action = NodeGit.Tree.UPDATE.REMOVE;
update.path = "README.md";
return this.commit.getTree().then(function(tree) {
return tree.createUpdated(repo, 1, [update]);
})
.then(function(treeOid) {
return repo.getTree(treeOid);
})
.then(function(updatedTree) {
assert.throws(function () {
updatedTree.entryByName("README.md");
});
});
});

it("walks its entries and returns the same entries on both progress and end",
function() {
var repo = this.repository;
Expand Down