Skip to main content

Module git_ops

Module git_ops 

Source
Expand description

Git operations — auto-commit, push, PR creation.

These run after the agent completes to ensure all changes are committed, pushed, and a PR is created.

All GitHub API operations use [GhHttp] exclusively. The gh CLI is not used as a fallback to ensure consistent behavior across environments and simplify testing.

Structs§

AutoCommit
What auto_commit did, including blobs left unstaged because they exceed GitHub’s size limit

Enums§

PrCreateError
Errors that can occur during PR creation.

Functions§

auto_commit
Commit what the agent left, with the tool the repository uses (see commit).
create_pr_if_needed
Create a PR if one doesn’t already exist.
is_large_file_error
True when GitHub refused the push because a file is over its size limit (GH001). The 50 MB warning carries GH001 too, so only the refusal’s own wording counts
is_missing_remote_ref_error
is_transient_network_error
True when a push failure looks like a transient network error (dial timeout, i/o timeout, connection reset) rather than a ref rejection. A refused ref must not be retried, but a blipped endpoint deserves one immediate retry before the run is classified as push_failed.
large_file_lines
The File <path> is <n> MB; this exceeds GitHub's file size limit lines of a refused push
push_branch
Push the branch to origin.
rebase_on_branch
Rebase the current branch on top of origin/{branch}.
rebase_on_default
Rebase the current branch on the default branch.

Type Aliases§

PrCreateResult
Result type for PR creation operations.