>> @@ -0,0 +1,53 @@
>> +#include "clar_libgit2.h"
>> +#include "branch.h"
>> +
>> +static git_repository *repo;
>> +static git_reference *local_ref;
>> +static git_reference *remote_ref;
>> +static git_reference *non_branch_ref;
> 
> Even though, the git_reference_free is a no-op if it's parameter is
> NULL, this change would reduce the lookups from 9 to 3 - and should
> probably be done. Anyway, I didn't want to be _too_ nit-picky about
> this, since the change itself is nice to have :-)

Right. I haven't realized until now that that the testing framework 
calls the init function for each test separately. I'm going to change 
the tests, although this means that the test will test not only 
git_branch_name() but also the lookup as before ;)