git status: send an explicit outsideCwd flag so symlink-escaping paths are non-selectable too (#9155 follow-up)

Open
#9,156 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript
Domain
backend, cli

Research direction

Start by tracing the server's git status entries and the gitStage and gitUnstage containment checks, then find where both clients determine whether rows are selectable. Add the server flag using the same real-path containment rule and preserve the lexical fallback for older daemons. Add the symlinked-directory test from the acceptance criteria; done means Stage All stages inside files and skips the outside symlink row without failing.

Written by the indexing model from the issue text.

Description

app dashboard enhancement from-review server

Context

Identified during review of PR #9155 (#8187).

Description

#9155 marks git rows outside the session's folder as non-selectable. The clients derive "outside" from the cwd-relative path (.., a ../ prefix, or an absolute path), mirroring the server's lexical rule.

The server's gitStage and gitUnstage containment check goes further: it also refuses a path that is lexically inside the cwd but whose real path resolves outside it, through a symlink. The client cannot work that out. Such a row stays selectable, and a bulk Stage All that includes it still fails as a whole.

Acceptance Criteria

  • The server's git status entries carry an explicit outsideCwd: true (optional; omitted when false) computed with the same real-path check that gitStage and gitUnstage enforce.
  • Both clients prefer the server flag and fall back to the lexical rule for older daemons.
  • A test with a symlinked directory inside the cwd that points outside it: the row is non-selectable, and Stage All stages only the truly inside files, with no failure.
Dominant language
JavaScript
Stars
7
Forks
1
Avg merge
2h 3m
Merged PRs (30d)
333

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from blamechris/chroxy

All issues in blamechris/chroxy

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.