diff --git a/lib/Repository.js b/lib/Repository.js index de77ae48..2ae7e276 100644 --- a/lib/Repository.js +++ b/lib/Repository.js @@ -588,11 +588,9 @@ class Repository extends Requestable { if (ref.path === oldPath) { ref.path = newPath; } - if (ref.type === 'tree') { - delete ref.sha; - } return ref; - }); + }) + .filter((ref) => ref.type !== 'tree'); return this.createTree(newTree); }) .then(({data: tree}) => this.commit(oldSha, tree.sha, `Renamed '${oldPath}' to '${newPath}'`))