Native Git staging reversal, tree creation, and local commits.
Package: git.commit
Reachable from entry: yes
atomic.mlasatomic→ src/git/atomic.mlhash.mlashash→ src/git/hash.mlindex.mlasindex_api→ src/git/index.mlobjects.mlasobjects→ src/git/objects.mlrepository.mlasrepo_api→ src/git/repository.mlstatus.mlasstatus_api→ src/git/status.mlstd/bytes.mlasby→../release_1_3_17_ml/std/bytes.ml— external dependencystd/fs.mlasfs→../release_1_3_17_ml/std/fs.ml— external dependencystd/string.mlass→../release_1_3_17_ml/std/string.ml— external dependencystd/time.mlastime→../release_1_3_17_ml/std/time.ml— external dependency
const COMMIT_ERR = 9407Commit error code.
function commitError(message)Build a Git commit error.
| Parameter | Type | Default | Description |
|---|---|---|---|
message |
dynamic |
— | Diagnostic text. |
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. |
function modeNumber(text)Parse an octal Git mode from a committed tree.
| Parameter | Type | Default | Description |
|---|---|---|---|
text |
dynamic |
— | Octal mode string. |
function modeText(mode)Render a numeric index mode as Git tree octal text.
| Parameter | Type | Default | Description |
|---|---|---|---|
mode |
dynamic |
— | Numeric file mode. |
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. |
function stageDeletion(repo, path)Stage removal of a tracked worktree path.
| Parameter | Type | Default | Description |
|---|---|---|---|
repo |
dynamic |
— | Open repository. |
path |
dynamic |
— | Repository-relative path. |
- git.commit.TreeNode — struct
- git.commit.TreeRecord — struct
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. |
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. |
function validIdentity(value)Reject names that could inject a second commit header.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Git identity field. |
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. |