Fix a bug in diff. Fixes checkout issue.

This fixes a `git checkout failure`.

@dinhviethoa