'Return the disk path of a ref.'

def refpath(self, name):

    if (getattr(self.path, 'encode', None) and getattr(name, 'decode', None)):
        name = name.decode(sys.getfilesystemencoding())
    if (os.path.sep != '/'):
        name = name.replace('/', os.path.sep)
    if (name == 'HEAD'):
        return os.path.join(self.worktree_path, name)
    else:
        return os.path.join(self.path, name)
