Skip to content

WorktreeConfig.base_dir uses String where Option<String> is idiomatic #90

@wollax

Description

@wollax

Problem

base_dir defaults to empty string via #[serde(default)], and resolve_worktree_dir checks .filter(|d| !d.is_empty()) to treat empty as absent. This "empty string means unset" pattern is fragile — a user setting base_dir = "" gets silent default behavior instead of a validation error.

Solution

Use Option<String> with #[serde(default, skip_serializing_if = "Option::is_none")] to make "unset" explicit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogKata backlog issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions