make sure clang-tidy is diffing against the right thing (#28788)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/28788
Okay, my last fix was wrong because it turns out that the base SHA is
computed at PR time using the actual repo's view of the base ref, not
the user's. So if the user doesn't rebase on top of the latest master
before putting up the PR, the diff thing is wrong anyway.
This PR fixes the issue by not relying on any of these API details and
just getting the merge-base of the base and head refs, which should
guarantee we are diffing against the right thing.
This solution taken from https://github.com/github/VisualStudio/pull/1008
Test Plan: Imported from OSS
Differential Revision: D18172391
Pulled By: suo
fbshipit-source-id: 491a50119194508b2eefa5bd39fe813ca85f27b1