#!/usr/bin/env python3

import os.path
import portage
import shutil

repo = portage.db['/']['vartree'].settings.repositories['gentoo']
git = os.path.join(repo.location, '.git')

if repo.sync_type != 'git' and os.path.exists(git):
    shutil.rmtree(git)
