Catch exception raised when accessing the head of the repo
When trying to diff a branch against master when master does not exist
but the repo is not empty, pygit2 may raise an exception. Let's catch
it and set the compare_branch to None as if the repo was empty.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>