add Repository#descendant_of?

cc @ymendel @brianmario @vmg 
I pushed some test cases that illustrate this problem and @vmg has volunteered to do the libgit2 fix. Afterwards I guess we can reason about which ones are useful to keep and I'll clean up the commits.