qwen-code/packages
chinesepowered 567a834477
fix(core): read the stash reflog from the common git dir (#7774)
* fix(core): read the stash reflog from the common git dir

* fix(core): harden the commondir read the same way the HEAD read is

`resolveCommonGitDir` reads `<gitDir>/commondir` with a plain `readFile`,
while `gitDirect.ts` reads that same file through `readFirstLineNoFollow`,
which opens with `O_NOFOLLOW | O_NONBLOCK` and bounds the read. The two
reads had different protections against the same hostile input.

That matters because `getGitWorkingTreeStatus` polls unattended: a
`commondir` named pipe planted in a cloned repository would hang the
`readFile` forever and pin a libuv thread-pool slot, and a symlink would
be followed out of the repository. The adjacent `countStashEntries`
already guards against exactly this hazard for the reflog it reads.

Move `readFirstLineNoFollow` to `gitUtils.ts` and point both callers at
it. It cannot be exported from `gitDirect.ts` because `gitDirect.ts`
already imports `gitDiff.ts` — that would close an import cycle.
`gitUtils.ts` imports nothing but node builtins, so it can be shared by
both.
2026-07-28 08:17:03 +00:00
..
acp-bridge fix(daemon): harden Todo Stop Guard continuations (#7821) 2026-07-28 06:51:40 +00:00
audio-capture chore(release): v0.21.0 (#7675) 2026-07-24 13:47:34 +00:00
channels fix(daemon): harden Todo Stop Guard continuations (#7821) 2026-07-28 06:51:40 +00:00
chrome-extension chore(release): v0.21.0 (#7675) 2026-07-24 13:47:34 +00:00
cli fix(daemon): harden Todo Stop Guard continuations (#7821) 2026-07-28 06:51:40 +00:00
core fix(core): read the stash reflog from the common git dir (#7774) 2026-07-28 08:17:03 +00:00
cua-driver fix(mcp): add opt-in model payload filtering (#7413) 2026-07-21 09:49:04 +00:00
desktop fix(daemon): harden Todo Stop Guard continuations (#7821) 2026-07-28 06:51:40 +00:00
mobile-mcp chore(release): v0.20.1 (#7461) 2026-07-22 02:00:22 +00:00
sdk-java fix(sdk-java): Harden daemon transport reliability (#7603) 2026-07-24 04:22:05 +00:00
sdk-python fix(sdk-python): validate max_tool_calls and max_subagent_depth as integers (#7548) 2026-07-23 08:45:13 +00:00
sdk-typescript feat(web-shell): add native workspace folder picker (#7849) 2026-07-28 05:58:13 +00:00
vscode-ide-companion feat: Gate session writer lease behind opt-in (#7894) 2026-07-28 04:37:02 +00:00
web-shell feat(web-shell): add Channel configuration flows (#7893) 2026-07-28 05:58:26 +00:00
web-templates fix(cli): measure insight days and hours in local time everywhere (#7670) 2026-07-24 15:41:13 +00:00
webui feat(web-shell): add native workspace folder picker (#7849) 2026-07-28 05:58:13 +00:00
zed-extension