function cleanupTree(treeInfo) {
            var files = {};
            treeInfo.tree.forEach(function(entry) {
                files["/" + entry.path] = entry;
            });
            files["/"] = {
                sha: treeInfo.sha
            };
            return {
                sha: treeInfo.sha,
                files: files,
                tree: treeInfo.tree
            };
        }
Turns Github's tree format into a map for path -> treeEntry lookup