async def generate_entities(self) -> AsyncGenerator[ChunkEntity, None]:
        """Generate entities from GitHub repository.

        Yields:
            Repository, directory, and file entities
        """
        if not hasattr(self, "repo_name") or not self.repo_name:
            raise ValueError("Repository name must be specified")

        async with httpx.AsyncClient() as client:
            repo_url = f"{self.BASE_URL}/repos/{self.repo_name}"
            repo_data = await self._get_with_auth(client, repo_url)

            # Use specified branch if available, otherwise use default branch
            branch = (
                self.branch
                if hasattr(self, "branch") and self.branch
                else repo_data["default_branch"]
            )

            # Verify that the branch exists
            if hasattr(self, "branch") and self.branch:
                # Get list of branches for the repository
                branches_url = f"{self.BASE_URL}/repos/{self.repo_name}/branches"
                branches_data = await self._get_paginated_results(client, branches_url)
                branch_names = [b["name"] for b in branches_data]

                if branch not in branch_names:
                    available_branches = ", ".join(branch_names)
                    raise ValueError(
                        f"Branch '{branch}' not found in repository '{self.repo_name}'. "
                        f"Available branches: {available_branches}"
                    )

            logger.info(f"Using branch: {branch} for repo {self.repo_name}")

            async for entity in self._traverse_repository(client, self.repo_name, branch):
                yield entity
Generate entities from GitHub repository.

        Yields:
            Repository, directory, and file entities
        
backend/airweave/platform/sources/github.py