Skip to content

Always detach managed Git checkouts at the locked commit #42

Closed

Description

@LunaStev

Problem

A fresh clone can remain attached to its default branch because checkout_commit returns immediately when HEAD already equals the desired commit. Managed dependency directories are intended to represent lockfile commits, not editable tracking branches.

This behavior is related to, but separate from, dirty-tree validation in #19.

Expected behavior

Every managed Git dependency should be in detached-HEAD state at the exact locked commit before Vex reads its manifest or sources.

Acceptance criteria

  • Verify both the commit and detached state.
  • Detach a clean checkout even when its current commit already matches.
  • Refuse to detach when local changes would be affected.
  • Apply the invariant after clone, fetch, update, offline reuse, and lock restoration.
  • Add integration coverage for a fresh clone whose default branch already points at the selected commit.

Activity

  1. added
    bug
    dependencies
    stability
    on Sep 18, 2026
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

    bugdependenciesstability

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions