Currently, I am listing the files on git tree using:
repository
.getBranchCommit(treeRefName)
.then((commit)=> commit.getTree())
.then((tree) => {
obj.repositoryTree = tree;
obj.repositoryTreeEntries = tree.entries();
fullfill(obj);
})
.catch(reject);
And further listing out OID
using oid method. Further trying to get commit message using:
Git.Commit
.lookup(repository, oid)
.then((commit) => {
console.log(commit.message());
})
.then(() => fullfill(obj))
.catch(reject);
As mentioned in lookup method. The problem is that it kept crashing. Further on a simple git log
from terminal revealed that the oid
was not the same as commit hash. Where exactly am I going wrong with this, to fetch the last commit that changed the file?