From 811886f801909c78ed84bee4dc4bed46100bbd42 Mon Sep 17 00:00:00 2001 From: Max White Date: Sat, 29 Aug 2015 23:11:57 +0100 Subject: [PATCH] Move filters out tree nodes, rather than delete their ref --- github.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github.js b/github.js index 6f8dc215..3c6901d5 100644 --- a/github.js +++ b/github.js @@ -655,9 +655,9 @@ updateTree(branch, function(err, latestCommit) { that.getTree(latestCommit+"?recursive=true", function(err, tree) { // Update Tree - tree.forEach(function(ref) { + tree = tree.filter(function(ref) { if (ref.path === path) ref.path = newPath; - if (ref.type === "tree") delete ref.sha; + return ref.type !== "tree"; }); that.postTree(tree, function(err, rootTree) {