Skip to main content

Module commit

Module commit 

Source
Expand description

Git commit and push operations.

This module provides functions for creating commits, restoring tracked paths, and pushing to upstream remotes. It handles error classification and provides clear feedback on failures.

§Invariants

  • Upstream must be configured before pushing
  • Empty commit messages are rejected
  • No-changes commits are rejected
  • Path restores only operate on tracked files under the repo root

§What this does NOT handle

  • Status checking (see git/status.rs)
  • LFS validation (see git/lfs.rs)
  • Repository cleanliness (see git/clean.rs)

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.