MCPcopy Create free account
hub / github.com/MarsWang42/Awel / commitCurrentBranch

Function commitCurrentBranch

packages/cli/src/comparison.ts:130–138  ·  view source on GitHub ↗
(projectCwd: string, modelId: string)

Source from the content-addressed store, hash-verified

128}
129
130function commitCurrentBranch(projectCwd: string, modelId: string): void {
131 if (!hasUncommittedChanges(projectCwd)) return;
132 try {
133 execGit(projectCwd, 'add -A');
134 execGit(projectCwd, `commit -m "Awel: ${modelId}" --allow-empty`);
135 } catch {
136 // Commit might fail if nothing to commit, that's ok
137 }
138}
139
140function getCurrentBranch(projectCwd: string): string {
141 return execGit(projectCwd, 'rev-parse --abbrev-ref HEAD');

Callers 4

createRunFunction · 0.85
switchRunFunction · 0.85
markRunCompleteFunction · 0.85
selectRunFunction · 0.85

Calls 2

hasUncommittedChangesFunction · 0.85
execGitFunction · 0.85

Tested by

no test coverage detected