Persists the merge commit SHA on WorktreeEntity for every successful single-task and unit merge, and adds a TaskMergeService.RevertMergeAsync + revert_merge MCP tool that undoes a merged task's merge via `git revert -m 1` (never reset/rewrite, since the target checkout is shared). Rejects cleanly when there's no recorded SHA, the repo is mid-merge/mid-revert, or the target has foreign uncommitted changes; a conflicting revert aborts immediately. Also exposes the new mergeCommit field via get_task_worktree.
29 lines
743 B
C#
29 lines
743 B
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace ClaudeDo.Data.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddWorktreeMergeCommit : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "merge_commit",
|
|
table: "worktrees",
|
|
type: "TEXT",
|
|
nullable: true);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "merge_commit",
|
|
table: "worktrees");
|
|
}
|
|
}
|
|
}
|