ironflow-ops-git
Git operations for Ironflow workflows, powered by the git2 crate.
Provides Git operations (clone, commit, branch, merge, diff, rebase, stash, tag, submodule, worktree) as tracked workflow steps. All git2 calls run inside spawn_blocking since the library is synchronous.
Usage
[]
= "0.1"
Open a repository
use GitRepo;
let repo = open?;
Tracked operations
use GitRepo;
use CreateCommit;
use CreateBranch;
let repo = open?;
let branch = new;
ctx.operation.await?;
let commit = new
.message
.author;
ctx.operation.await?;
Available operations
| Module | Operations |
|---|---|
blame |
Blame |
branch |
Create, delete, list, rename |
checkout |
Checkout branch, file, commit |
cherrypick |
Cherry-pick |
commit |
Create, amend |
config |
Get, set, list |
diff |
Diff (tree, index, workdir) |
fetch |
Fetch |
graph |
Ahead/behind, merge base |
index |
Add, remove, reset |
log |
Log with filters |
merge |
Merge |
object |
Read blob, tree entries |
rebase |
Rebase |
reflog |
Reflog entries |
refs |
Create, delete, list refs |
remote |
Add, remove, list, push |
repository |
Init, clone |
reset |
Reset (soft, mixed, hard) |
stash |
Stash, pop, list, drop |
status |
Status |
submodule |
Init, update, add, sync |
tag |
Create, delete, list |
worktree |
Add (optionally detached at a commit), remove, list, prune |
Authentication
Network operations (RepoClone, FetchRemote, PushRemote, RemotePrune, RemoteDefaultBranch, SubmoduleUpdate) authenticate over HTTPS with the token held in the git_token workflow secret, sent with the username oauth2. Override either per operation:
use RepoClone;
let clone = new
.bare
.token_secret
.username;
ctx.operation.await?;
Without that secret, credentials come from the SSH agent, the git credential helper, then libgit2's default credential, as before.
The token never lands in a step record: credentials embedded in a URL are masked as https://***@host/... in every input(), output and error message, and a token read from the secret store is scrubbed from error messages.