Git: work more robustly in bare repos.