feat(worker): add PlanningAggregator.CleanupIntegrationBranchAsync
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -194,6 +194,26 @@ public class PlanningAggregatorTests : IDisposable
|
||||
return (parentId, subA, subB);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task CleanupIntegrationBranchAsync_RemovesBranchIfPresent()
|
||||
{
|
||||
var db = NewDb();
|
||||
var repo = NewRepo();
|
||||
GitRepoFixture.RunGit(repo.RepoDir, "branch", "-m", "main");
|
||||
var (parentId, _, _) = await SeedPlanningWithTwoChildrenAsync(db, repo);
|
||||
|
||||
var git = new GitService();
|
||||
var svc = new PlanningAggregator(db.CreateFactory(), git, NullLogger<PlanningAggregator>.Instance);
|
||||
|
||||
var built = await svc.BuildIntegrationBranchAsync(parentId, "main", CancellationToken.None);
|
||||
var ok = Assert.IsType<CombinedDiffResult.Ok>(built);
|
||||
|
||||
await svc.CleanupIntegrationBranchAsync(parentId, CancellationToken.None);
|
||||
|
||||
var branches = await git.ListLocalBranchesAsync(repo.RepoDir, CancellationToken.None);
|
||||
Assert.DoesNotContain(branches, b => b == ok.Value.IntegrationBranch);
|
||||
}
|
||||
|
||||
private void SeedWorktreeWithFile(ClaudeDoDbContext ctx, GitRepoFixture repo, string taskId, string filename, string content)
|
||||
{
|
||||
var wtPath = Path.Combine(Path.GetTempPath(), $"wt_{Guid.NewGuid():N}");
|
||||
|
||||
Reference in New Issue
Block a user