[Hot Fix] Fix a bug in diff. Fixes checkout issue.

This fixes a `git checkout failure`.

#2597 

@dinhviethoa 
Could you add a comment here to describe that this.path is mutated during checkout.