Skip to content

Show untracked file warning when there are no tracked changes#411

Merged
robinaugh merged 1 commit intomainfrom
jason/fix-untracked-only-warning
Mar 11, 2026
Merged

Show untracked file warning when there are no tracked changes#411
robinaugh merged 1 commit intomainfrom
jason/fix-untracked-only-warning

Conversation

@robinaugh
Copy link
Contributor

Summary

  • When only untracked files exist (no staged/unstaged changes to tracked files), GeneratePatchFile returned an empty PatchFile{}, discarding the untracked files metadata
  • The untracked file warning in service_run.go was gated behind patchFile.Written, so it was never shown in this case
  • Now GeneratePatchFile preserves untracked metadata even when the diff is empty, and the warning displays independently of whether a patch was written

Test plan

  • New unit test: GeneratePatchFile with only untracked files returns metadata with Written: false
  • New unit test: untracked file warning appears when no patch is written
  • Existing tests pass (go test ./internal/... ./cmd/...)

When only untracked files exist (no staged or unstaged changes to
tracked files), the untracked file warning was silently dropped.
GeneratePatchFile discarded the metadata when the diff was empty,
and the warning was gated behind patchFile.Written.
@robinaugh robinaugh self-assigned this Mar 11, 2026
@robinaugh robinaugh marked this pull request as ready for review March 11, 2026 12:37
@robinaugh robinaugh merged commit 0f16998 into main Mar 11, 2026
1 check passed
@robinaugh robinaugh deleted the jason/fix-untracked-only-warning branch March 11, 2026 12:42
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.

2 participants