Skip to content

Synchronize working directory files upon branch switch & protect uncommitted changes #8

Description

@barissalihbabacan

Problem

Calling switch_branch only updates .osmos/HEAD with the target branch name without updating files on disk. If the user creates a commit on the new branch, it incorporates leftover files from the previous branch.

Proposed Solution

  1. Verify working directory is clean relative to current HEAD (or warn/stash).
  2. Clean files present in current HEAD and write files from target branch HEAD commit.
  3. Update .osmos/HEAD.

Acceptance Criteria

  • Switching between branches replaces disk files with the target branch's snapshot.
  • Prevents switching if dirty files would be overwritten.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions