Skip to content

Keep fetch --porcelain when submodule recursion is explicitly No [patch] - #206

Merged
matt-edmondson merged 1 commit into
mainfrom
fix/142-fetch-porcelain-recurse-no
Oct 12, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
fix/142-fetch-porcelain-recurse-no

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #142

Before: Fetch().RecursingSubmodules(GitSubmoduleRecursion.No) dropped --porcelain, so the result had DetailAvailable == false and an empty Updates list. This affected callers who pass No to override a host's submodule.recurse=true.

After: --porcelain is dropped only for Yes and OnDemand. git rejects the pair only for a recursion mode that actually recurses. --recurse-submodules=no with --porcelain exits 0 and prints the porcelain records (checked against git 2.43).

Changes:

  • GitFetchBuilder.IsPorcelainAvailable now accepts _submoduleRecursion is null or GitSubmoduleRecursion.No, and its remarks are updated.
  • CLAUDE.md point 7 no longer says git refuses --porcelain with --recurse-submodules "outright".
  • New builder test FetchKeepsPorcelainWhenRecursionIsExplicitlyNo.
  • New integration test FetchWithRecursionExplicitlyOffStillReportsTheUpdatesAsync. It runs against real git and checks that Updates is populated, and that DetailAvailable depends only on the version threshold.

Testing:

  • Both new tests fail when the GitFetchBuilder change is reverted, and pass with it.
  • Full suite: 792/792 passed on Linux with git 2.43.

🤖 Generated with Claude Code

https://claude.ai/code/session_015EHSar1iXDsM19Xk1rHpKp


Generated by Claude Code

git refuses --porcelain only alongside a --recurse-submodules mode that
recurses (yes, on-demand). An explicit RecursingSubmodules(No), as used to
override a host's submodule.recurse=true, now keeps the itemised Updates
instead of reporting DetailAvailable false. CLAUDE.md no longer says git
refuses the pair outright.

Fixes #142

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015EHSar1iXDsM19Xk1rHpKp
@sonarqubecloud

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 39df2a0 into main Oct 12, 2026
16 checks passed
@matt-edmondson
matt-edmondson deleted the fix/142-fetch-porcelain-recurse-no branch October 12, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fetch().RecursingSubmodules(No) drops --porcelain, so an explicit "don't recurse" loses all fetch detail (Updates empty)

2 participants