def default_branch()

in asfyaml/dataobjects.py [0:0]


    def default_branch(self):
        """Returns the default branch for this repository."""
        head_path = os.path.join(self.path, "HEAD")
        if os.path.isfile(head_path):
            hb = open(head_path).read().removeprefix("ref: refs/heads/").strip()
        else:
            hb = DEFAULT_BRANCH.removeprefix("refs/heads/")
        return hb