I hate myself for not exposing the rename data out of RevWalk. It means we have to do it twice here. *sigh*

A cleaner way to do this is to do it after-the-fact. That is, have your code be something like:

  TreeWalk blobWalk = TreeWalk.forPath(reader, currentPath, commit.getTree());
  if (blobWalk == null) {
    if (next == null)
      break;  // The file never existed. Abort traversal.

    // Maybe the file was renamed?
    ... diff next's tree against commit.getTree()
    ... see if next's path was renamed
    ... if so, update currentPath
    ... if not, break
  }
  ... run blame on this path ...