Skip to content

Commit c58e101

Browse files
committed
refactor: Repository.move filters nodes instead of deleting their sha
closes github-tools#215
1 parent 30f9e76 commit c58e101

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/Repository.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,11 +588,9 @@ class Repository extends Requestable {
588588
if (ref.path === oldPath) {
589589
ref.path = newPath;
590590
}
591-
if (ref.type === 'tree') {
592-
delete ref.sha;
593-
}
594591
return ref;
595-
});
592+
})
593+
.filter((ref) => ref.type !== 'tree');
596594
return this.createTree(newTree);
597595
})
598596
.then(({data: tree}) => this.commit(oldSha, tree.sha, `Renamed '${oldPath}' to '${newPath}'`))

0 commit comments

Comments
 (0)