def samefile(self, repo_file, ext_file):
        if self.hard:
            if os.path.islink(ext_file):
                return False
            if not os.path.exists(repo_file):
                return False
            return filecmp.cmp(repo_file, ext_file, shallow=False)
        else:
            # not using os.samefile since it resolves repo_file as well which
            # is not what we want
            return os.path.realpath(ext_file) == os.path.abspath(repo_file)