Skip to content

DiffState: deduplicate loadForWorktree / loadForProject #67

@2witstudios

Description

@2witstudios

Problem

DiffState.loadForWorktree() and loadForProject() are near-identical — both cancel the previous task, set state, launch a task that calls fetchUnstaged + fetchPRs, and start watching. The only differences are which path/branch they use and which current* property they set.

Location

apps/purepoint-macos/purepoint-macos/State/DiffState.swift — lines 30-60

Suggested Fix

Extract a shared load(path:branch:) and have both public methods call it after setting the appropriate current* properties.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions