Skip to content

fix(cli): require cortex workspace marker directory#316

Open
OnlyYu1996 wants to merge 1 commit into
CortexLM:mainfrom
OnlyYu1996:fix-workspace-root-cortex-marker-dir
Open

fix(cli): require cortex workspace marker directory#316
OnlyYu1996 wants to merge 1 commit into
CortexLM:mainfrom
OnlyYu1996:fix-workspace-root-cortex-marker-dir

Conversation

@OnlyYu1996
Copy link
Copy Markdown

Fixes PlatformNetwork/bounty-challenge#53138.

find_workspace_root() now only treats .cortex as a workspace marker when it is a directory. A plain file named .cortex in a nested directory is ignored, so root detection continues upward to the actual workspace marker. The .git fallback continues to use exists() so Git worktree .git files still work.

Validation:

  • cargo +1.90.0 fmt --package cortex-cli --check
  • isolated rustc +1.90.0 --test harness covering .cortex file ignored and .git file fallback retained
  • git diff --check

Note: cargo +1.90.0 test -p cortex-cli test_find_workspace_root -- --nocapture is blocked on this Windows machine by the existing workspace aws-lc-sys MSVC build failure before cortex-cli tests run.

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

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.

[BUG][v0.0.7] Workspace root detection accepts .cortex file (not directory) and may stop at wrong root

1 participant