s/attributes/filemode/ for pygit2 >= 0.18.0