Don't crash when there's no HEAD node
Fix type causing "no fetch method" bug
Don't crash when .git dir is removed