Skip to content

Branch

🛈 DocStrings

Source code in src/githarbor/core/models.py
@dataclass
class Branch:
    name: str
    """Name of the branch."""
    sha: str
    """SHA hash of the latest commit on this branch."""
    protected: bool = False
    """Whether the branch has protection rules enabled."""
    default: bool = False
    """Whether this is the default branch of the repository."""
    created_at: datetime | None = None
    """Date and time when the branch was created."""
    updated_at: datetime | None = None
    """Date and time when the branch was last updated."""
    last_commit_date: datetime | None = None
    """Date of the last commit."""
    last_commit_message: str | None = None
    """Message of the last commit."""
    last_commit_author: User | None = None
    """Author of the last commit."""
    protection_rules: dict[str, Any] | None = None
    """Branch protection settings if any."""

created_at class-attribute instance-attribute

created_at: datetime | None = None

Date and time when the branch was created.

default class-attribute instance-attribute

default: bool = False

Whether this is the default branch of the repository.

last_commit_author class-attribute instance-attribute

last_commit_author: User | None = None

Author of the last commit.

last_commit_date class-attribute instance-attribute

last_commit_date: datetime | None = None

Date of the last commit.

last_commit_message class-attribute instance-attribute

last_commit_message: str | None = None

Message of the last commit.

name instance-attribute

name: str

Name of the branch.

protected class-attribute instance-attribute

protected: bool = False

Whether the branch has protection rules enabled.

protection_rules class-attribute instance-attribute

protection_rules: dict[str, Any] | None = None

Branch protection settings if any.

sha instance-attribute

sha: str

SHA hash of the latest commit on this branch.

updated_at class-attribute instance-attribute

updated_at: datetime | None = None

Date and time when the branch was last updated.

:fa-brands-github: Show source on GitHub