EzDevInfo.com

Gift

Swift bindings to libgit2.

How can I get the contents of a file of a git commit with the gift library?

I am using the https://github.com/notatestuser/gift library and here's what I have:

gitCommit.tree().contents (err, gitTreeContents) ->
  console.log gitTreeContents

This gives me the tree contents, which is an array with objects that look like:

{ repo: 
   { path: '/mygitrepo',
     bare: false,
     dot_git: '/mygitrepo/.git',
     git: 
      { [Function]
        cmd: [Function],
        streamCmd: [Function],
        list_remotes: [Function],
        refs: [Function] } },
  id: 'ed38d79b10503a4e7e68910f37f387f24dedd5fa',
  name: 'address.js',
  mode: '100644' }

So two questions. First, what is that id referring to? It's not a commit sha, so I assume it's a treeish? Second, how can I see what the file looked like at that point in time?

Thanks


Source: (StackOverflow)