Skip to content

Latest commit

 

History

History
208 lines (136 loc) · 6.38 KB

File-src-git-commit-ml-443927633.md

File metadata and controls

208 lines (136 loc) · 6.38 KB

src/git/commit.ml

Home · Files

Native Git staging reversal, tree creation, and local commits.

Package: git.commit

Reachable from entry: yes

Imports

  • atomic.ml as atomic → src/git/atomic.ml
  • hash.ml as hash → src/git/hash.ml
  • index.ml as index_api → src/git/index.ml
  • objects.ml as objects → src/git/objects.ml
  • repository.ml as repo_api → src/git/repository.ml
  • status.ml as status_api → src/git/status.ml
  • std/bytes.ml as by → ../release_1_3_17_ml/std/bytes.ml — external dependency
  • std/fs.ml as fs → ../release_1_3_17_ml/std/fs.ml — external dependency
  • std/string.ml as s → ../release_1_3_17_ml/std/string.ml — external dependency
  • std/time.ml as time → ../release_1_3_17_ml/std/time.ml — external dependency

Declarations

COMMIT_ERR

const COMMIT_ERR = 9407

Commit error code.

View source

commitError

function commitError(message)

Build a Git commit error.

Parameter Type Default Description
message dynamic — Diagnostic text.

View source

create

function create(repo, message)

Commit the exact staged index, leaving unstaged edits in the worktree.

Parameter Type Default Description
repo dynamic — Open repository.
message dynamic — Commit message.

View source

modeNumber

function modeNumber(text)

Parse an octal Git mode from a committed tree.

Parameter Type Default Description
text dynamic — Octal mode string.

View source

modeText

function modeText(mode)

Render a numeric index mode as Git tree octal text.

Parameter Type Default Description
mode dynamic — Numeric file mode.

View source

nodeLess

function nodeLess(left, right)

Compare tree child names by Git's directory-aware ordering.

Parameter Type Default Description
left dynamic — First node.
right dynamic — Second node.

View source

stageDeletion

function stageDeletion(repo, path)

Stage removal of a tracked worktree path.

Parameter Type Default Description
repo dynamic — Open repository.
path dynamic — Repository-relative path.

View source

unstage

function unstage(repo, path)

Restore one staged path from HEAD without touching its worktree file.

Parameter Type Default Description
repo dynamic — Open repository.
path dynamic — Repository-relative path.

View source

updateRef

function updateRef(repo, refName, oldId, newId)

Write a ref through a durable lock, checking HEAD has not moved.

Parameter Type Default Description
repo dynamic — Open repository.
refName dynamic — Full branch ref.
oldId dynamic — Expected old object ID.
newId dynamic — New commit ID.

View source

validIdentity

function validIdentity(value)

Reject names that could inject a second commit header.

Parameter Type Default Description
value dynamic — Git identity field.

View source

writeTree

function writeTree(repo, entries, prefix = "", depth = 0)

Build one tree object from sorted stage-zero index entries.

Parameter Type Default Description
repo dynamic — Open repository.
entries dynamic — All staged entries.
prefix dynamic "" Current directory prefix.
depth dynamic 0 Recursion guard.

View source