nit: if you omit the type on `commit`, I think this could all fit on one line:

    return store.retrieveObject(headSha, ObjectTypes.COMMIT).then((commit) {