Skip to main content

Module commit

Module commit 

Source
Expand description

Git commit and push facade.

Purpose:

  • Expose commit, restore, upstream, and rebase-aware push operations from a thin git module.

Responsibilities:

  • Re-export working-tree mutation helpers.
  • Re-export upstream/query helpers and rebase-aware push behavior.
  • Keep tests and sub-concerns in focused companions.

Scope:

  • Git commit/push workflows only.
  • Error types, status helpers, and branch lookup remain in sibling git modules.

Usage:

  • Imported through crate::git by command workflows and tests.

Invariants/assumptions:

  • Public APIs preserve existing behavior and error types.
  • Rebase-aware push remains the single entrypoint for retrying non-fast-forward pushes.

Functionsยง

abort_rebase
Abort an in-progress rebase.
add_paths_force
Force-add existing paths, even if they are ignored.
commit_all
Create a commit with all changes.
fetch_branch
Fetch a specific branch from origin.
is_ahead_of_upstream
Check if HEAD is ahead of the configured upstream.
is_behind_upstream
Check if the current branch is behind its upstream.
list_conflict_files
List files with merge conflicts.
push_current_branch
Push the current branch to a remote.
push_head_to_branch
Push HEAD to a specific branch on a remote.
push_upstream
Push HEAD to the configured upstream.
push_upstream_allow_create
Push HEAD to origin and create upstream tracking.
push_upstream_with_rebase
Push HEAD to upstream, rebasing on non-fast-forward rejections.
rebase_onto
Rebase current branch onto a target reference.
restore_tracked_paths_to_head
Restore tracked paths to the current HEAD (index + working tree).
revert_uncommitted
Revert uncommitted changes, restoring the working tree to current HEAD.
upstream_ref
Get the configured upstream for the current branch.