The method name does not describe what the method it is doing. 

In general it simply compares if the entries of two different trees are equal, right? But don't you just want to know there is an entry in the index for this file? Why do you have to check if the entry in the index  is different from the entry in head?