<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _git_dir(repo, path):
 """ Find the git dir that's appropriate for the path"""

    name = "%s" % (path,)
    if name in ['HEAD', 'ORIG_HEAD', 'FETCH_HEAD', 'index', 'logs']:
        return repo.git_dir
    return repo.common_dir