Skip to content

fix(shell): wrap git fs adapter unlink with fsError for proper ENOENT code#1249

Merged
threepointone merged 1 commit intocloudflare:mainfrom
jonnyparris:fix/git-fs-adapter-error-codes
Apr 4, 2026
Merged

fix(shell): wrap git fs adapter unlink with fsError for proper ENOENT code#1249
threepointone merged 1 commit intocloudflare:mainfrom
jonnyparris:fix/git-fs-adapter-error-codes

Conversation

@threepointone
Copy link
Copy Markdown
Contributor

@threepointone threepointone commented Apr 1, 2026

… code

isomorphic-git's FileSystem.rm() catches errors with err.code === 'ENOENT' to silently ignore missing files. The Workspace filesystem throws errors without a .code property, so unlink on a missing file (e.g. .git/shallow during non-shallow clone) propagated as an unhandled error.

Wrap unlink with the existing fsError() helper, matching the pattern already used by readFile, stat, lstat, and readlink in the same file.


Open with Devin

… code

isomorphic-git's FileSystem.rm() catches errors with err.code === 'ENOENT'
to silently ignore missing files. The Workspace filesystem throws errors
without a .code property, so unlink on a missing file (e.g. .git/shallow
during non-shallow clone) propagated as an unhandled error.

Wrap unlink with the existing fsError() helper, matching the pattern
already used by readFile, stat, lstat, and readlink in the same file.
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 1, 2026

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@1249

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@1249

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@1249

hono-agents

npm i https://pkg.pr.new/hono-agents@1249

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@1249

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@1249

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@1249

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@1249

commit: 49618dd

@threepointone threepointone merged commit bfbed21 into cloudflare:main Apr 4, 2026
2 checks passed
@github-actions github-actions bot mentioned this pull request Apr 4, 2026
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