Include a tree hash ID in the JSON views for trees and commits.

Sample tree view (note the new top-level "id" property):

$ curl -s 'http://localhost:8080/gitiles/+/master/lib?format=JSON'
)]}'
{
  "id": "35913812a8e851228502cf49de8cc299ec149280",
  "entries": [
    {
      "mode": 33188,
      "type": "blob",
      "id": "abed91637554aa423806eb199958d007a6b72510",
      "name": "BUCK"
    },
    {
      "mode": 16384,
      "type": "tree",
      "id": "1c0b739a3b621f4d004daf16eed83121c69c1ff0",
      "name": "guice"
    },
    {
      "mode": 16384,
      "type": "tree",
      "id": "0337998ca4c09f2956c2f21497d7324027874139",
      "name": "jetty"
    },
    {
      "mode": 16384,
      "type": "tree",
      "id": "5e33423164943cd96f9804e96be1968a29a30b62",
      "name": "jgit"
    },
    {
      "mode": 16384,
      "type": "tree",
      "id": "e238f03c6d6d08426e335c9a30d06e0db28e9db3",
      "name": "slf4j"
    }
  ]
}

Sample commit view (note the new "tree" field):

$ curl 'http://localhost:8080/third_party/gitiles/+/HEAD?format=JSON'
)]}'
{
  "commit": "df50acbf091b678e424b47a2786342c256508df5",
  "tree": "cf62a7dc041f76659efa0cf9fe16c81ddb967b56",
  "parents": [
    "92bb12fac93061d1aeb6c81cd5081e7afd1926a7"
  ],
  "author": {
    "name": "Ken Rockot",
    "email": "rockot@google.com",
    "time": "Mon May 12 14:42:58 2014 -0700"
  },
  ...
}

Change-Id: Ifb94a3a626392a38aa571090c2784dfe04569f21
4 files changed