Files
opencode-manager/frontend/src/lib/git-identity.ts
T
Chris Scott 53238a6324 feat(git): extend source control with worktrees, stashes, conflicts and identities
- Create a worktree from a new or existing branch
- Integrate a worktree branch into a target branch by merge commit or cherry-pick, with continue/abort on conflicts
- Delete a worktree with keep, delete-local, or delete-local-and-remote branch options, using safe branch deletion for unmerged branches
- Add a stash tab (list, push, apply, pop, drop) shared across a repository and its worktrees
- Rename and delete branches, optionally deleting the remote branch and updating scheduled base branches
- Detect in-progress merge, rebase, cherry-pick and revert operations and hand conflicts to an agent session
- Generate commit messages from staged changes with the default model
- Add a default git identity and saved per-repository identities written to git config
- Unify git error mapping behind a typed error and one route helper; consolidate git mutations and cache invalidation
- Update repository docs
2026-10-03 21:59:00 -04:00

16 lines
483 B
TypeScript

export interface GitIdentityValues {
name?: string | null
email?: string | null
}
/**
* Formats a git identity as `Name <email>`, using explicit placeholders when a
* part is missing and a single fallback when nothing is configured.
*/
export function formatGitIdentity(identity: GitIdentityValues): string {
const name = identity.name
const email = identity.email
if (!name && !email) return 'Not configured'
return `${name || 'No name'} <${email || 'No email'}>`
}