Track activity markers during merge/rebase
This commit is contained in:
parent
9994782748
commit
6d86a988f7
|
|
@ -141,6 +141,7 @@ export async function mergeAndClose(branch: string, opts?: { squash?: boolean; f
|
|||
|
||||
try {
|
||||
await vm.ensure((msg) => { spin.text = msg })
|
||||
if (session) await vm.setActivity(session.worktree, branch)
|
||||
await resolveConflicts(conflicts, root, (file) => { spin.text = `Resolving ${file}` })
|
||||
|
||||
if (opts?.squash) {
|
||||
|
|
@ -154,6 +155,8 @@ export async function mergeAndClose(branch: string, opts?: { squash?: boolean; f
|
|||
spin.fail(message)
|
||||
await git.abortMerge(root)
|
||||
process.exit(1)
|
||||
} finally {
|
||||
if (session) await vm.clearActivity(session.worktree, branch)
|
||||
}
|
||||
|
||||
if (session) await teardownSession(root, branch, session.worktree)
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ export async function action(branch: string) {
|
|||
|
||||
try {
|
||||
await vm.ensure((msg) => { resolveSpin.text = msg })
|
||||
await vm.setActivity(worktree, branch)
|
||||
|
||||
let round = 1
|
||||
while (conflicts.length > 0) {
|
||||
|
|
@ -53,5 +54,7 @@ export async function action(branch: string) {
|
|||
resolveSpin.fail(String((err as Error).message ?? err))
|
||||
await git.rebaseAbort(worktree)
|
||||
process.exit(1)
|
||||
} finally {
|
||||
await vm.clearActivity(worktree, branch)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -358,6 +358,12 @@ export async function isClaudeActive(worktree: string, branch: string): Promise<
|
|||
}
|
||||
}
|
||||
|
||||
/** Set the activity marker for a worktree (e.g. during conflict resolution). */
|
||||
export async function setActivity(worktree: string, branch: string): Promise<void> {
|
||||
const file = `${dirname(worktree)}/.activity-${branch}`
|
||||
await Bun.write(file, "active\n")
|
||||
}
|
||||
|
||||
/** Remove the activity marker file for a worktree. */
|
||||
export async function clearActivity(worktree: string, branch: string): Promise<void> {
|
||||
const file = `${dirname(worktree)}/.activity-${branch}`
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user