var nodegit = require("../");
var path = require("path");

/**
 * This shows how to get details from a tree entry or a blob
**/

nodegit.Repository.open(path.resolve(__dirname, "../.git"))
  .then(function(repo) {
    return repo.getTree("e1b0c7ea57bfc5e30ec279402a98168a27838ac9")
    .then(function(tree) {
      var treeEntry = tree.entryByIndex(0);

      // Tree entry doesn't have any data associated with the actual entry
      // To get that we need to get the index entry that this points to
      return repo.refreshIndex().then(function(index) {
        var indexEntry = index.getByPath(treeEntry.path());

        // With the index entry we can now view the details for the tree entry
        console.log("Entry path: " + indexEntry.path());
        console.log("Entry time in seconds: " + indexEntry.mtime().seconds());
        console.log("Entry oid: " + indexEntry.id().toString());
        console.log("Entry size: " + indexEntry.fileSize());
      });
    });
  })
  .done(function() {
    console.log("Done!");
  });

var nodegit = require("../");
var path = require("path");

/**
 * This shows how to get details from a tree entry or a blob
**/

nodegit.Repository.open(path.resolve(__dirname, "../.git"))
  .then(function(repo) {
    return repo.getTree("e1b0c7ea57bfc5e30ec279402a98168a27838ac9")
    .then(function(tree) {
      var treeEntry = tree.entryByIndex(0);

      // Tree entry doesn't have any data associated with the actual entry
      // To get that we need to get the index entry that this points to
      return repo.refreshIndex().then(function(index) {
        var indexEntry = index.getByPath(treeEntry.path());

        // With the index entry we can now view the details for the tree entry
        console.log("Entry path: " + indexEntry.path);
        console.log("Entry time in seconds: " + indexEntry.mtime.seconds());
        console.log("Entry oid: " + indexEntry.id.toString());
        console.log("Entry size: " + indexEntry.fileSize);
      });
    });
  })
  .done(function() {
    console.log("Done!");
  });

Change function calls to field accesses instead
Change function calls to field accesses instead

In details-for-tree-entry.js, there are several calls to functions of
an IndexEntry. However, those are actually fields on an object
instead of prototype functions so referring to them as functions will
cause a ReferenceError to be thrown. The fix is to not refer to them
as functions but to simply refer to them as fields instead.

Signed-off-by: Remy Suen <553f7e7fc51e9ff47ae89d5a0ebd06651241b998@gmail.com>
