Skip to content

One gitlink without a .gitmodules entry makes Submodules() report every submodule as Unknown with no checked-out SHA #191

Open

Description

@matt-edmondson

What's wrong

GitSubmoduleListBuilder.ApplyStatusAsync (GitIntegration/Builders/GitSubmoduleListBuilder.cs ~L115-130) runs a single git submodule status for the whole repository and, if it fails, returns the gitlinks unannotated.

Failure scenario (reproduced on git 2.43)

Someone commits a nested repository directly (git's "embedded repository" warning), creating a gitlink with no .gitmodules mapping:

  • ls-files --stage -z lists 160000 … inner
  • git submodule status dies: fatal: no submodule mapping found in .gitmodules for path 'inner', exit 128
  • every submodule, including correctly configured ones, comes back with State = Unknown and CheckedOutSha = null.

Why it matters

One stray gitlink wipes the state of every healthy submodule, with nothing telling the caller why. Tools that decide whether to run UpdateSubmodules based on state then act on no information.

Suggested fix

Run git submodule status -- <path> for the mapped gitlinks only (skipping paths absent from .gitmodules), or on failure retry per path, so only the unmapped entry stays Unknown.

Acceptance criteria

  • Integration test: a repo with one configured submodule and one unmapped gitlink reports the configured one's real state and SHA, and the unmapped one as Unknown.

Activity

  1. matt-edmondson commented on Oct 7, 2026

    @matt-edmondson
    ContributorAuthor

    Triage


    Generated by Claude Code

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions