Repository navigation
Conversation
Tia compared repository-root-relative paths returned by git against project-relative graph keys, so a project in e.g. `app/backend` never matched and Tia refused to run (TiaRequiresRepositoryRoot). - diff: pass `--relative`, which also drops files outside the project - status: strip the `--show-prefix` prefix and drop entries outside the project, handling both sides of renames and copies - show: resolve `sha:./path` against the working directory - remove the TiaRequiresRepositoryRoot guard, which is now handled Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N4yeezMMbXx22bzRpWJbGo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What:
Description:
Problem. When the project lives in a subdirectory of a larger git repository (for example
app/backend), Tia compares paths that git reports relative to the repository root (git diff --name-only,git status --porcelain) against graph keys that are relative to the project. They never match, so changed files are not mapped to tests. In 4.7.x this was a silent false green (only arch tests selected); in 5.2+Tia::handleParent()panics withTiaRequiresRepositoryRootinstead.Reproduction.
Change.
diffSinceSha:git diff --name-only --relative sha..HEAD.--relativeyields project-relative paths and excludes files outside the subdirectory.workingTreeChanges: keepsstatus --porcelain -z(always root-relative), strips thegit rev-parse --show-prefixprefix and drops entries outside the subdirectory. For renames/copies each of the two paths is handled independently, so a rename out of the project still reports the old in-project path, and a rename into the project reports the new one.Git::show:git show sha:./path, which git resolves against the working directory. This also covers thecomposer.lockbaseline lookup.check-ignorealready receives project-relative paths and runs with the project as cwd, so it needed no change.TiaRequiresRepositoryRootguard and exception: nothing in the subdirectory case remains unhandled. When the project is the repository root the prefix is empty and behaviour is unchanged (./is a no-op there).Tests.
tests/Unit/Plugins/Tia/ChangedFilesSubdirectory.phpbuilds a temporary repo with the project inapp/backendand a sibling directory, and covers: diff since a sha, modified/untracked status, renames into/out of/within the project, gitignored files, behaviourally unchanged files (usesshow),Git::show, and the repository-root case. Without the source changes 6 of 7 fail.composer test:lint,test:type:check,test:type:coverageandtest:unitpass locally.Backward compatibility. Repository-root projects behave exactly as before. Projects in a subdirectory go from a hard error to working.
TiaRequiresRepositoryRootwas@internal.One thing for maintainers:
Fingerprint::isTrackedByGitskips itsgit check-ignorewhen the project has no.gitof its own, so in a subdirectory project lockfile/config files are treated as tracked even if ignored. This was already the case and is left untouched here.🤖 Generated with Claude Code
https://claude.ai/code/session_01N4yeezMMbXx22bzRpWJbGo