This code is a little funky right now, and can return array("error message") and then try to call getHunks() on it. Additionally, each field loads the commit's changes separately.
Instead, load the commit's changes once and cache them, and handle exceptions appropriately.