Skip to content

fix: check context cancellation inside filepath.Walk in RepoZip#235

Merged
claude[bot] merged 1 commit intomainfrom
claude/issue-232-20260228-1010
Feb 28, 2026
Merged

fix: check context cancellation inside filepath.Walk in RepoZip#235
claude[bot] merged 1 commit intomainfrom
claude/issue-232-20260228-1010

Conversation

@claude
Copy link
Contributor

@claude claude bot commented Feb 28, 2026

Summary

  • Add a select { case <-ctx.Done(): return ctx.Err() } guard at the top of the filepath.Walk callback in internal/zip/zip.go
  • Previously, RepoZip passed the context to buildGitFileSet but ignored it during the walk; the walk would run to completion even if the 10-minute timeout from the caller fired mid-walk
  • The error is now propagated back to the caller so it can distinguish timeout vs other walk errors

Fixes #232

Generated with Claude Code

RepoZip accepted a context but only used it for the git ls-files subprocess.
The filepath.Walk ran to completion regardless of cancellation or timeout.
Now the walk callback checks ctx.Done() at the top of each iteration and
returns ctx.Err() immediately when the context is cancelled or timed out.

Co-Authored-By: Grey Newell <greyshipscode@gmail.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: claude[bot] <claude[bot]@users.noreply.github.com>
@claude claude bot merged commit 83c5fbe into main Feb 28, 2026
1 check passed
@claude claude bot deleted the claude/issue-232-20260228-1010 branch February 28, 2026 10:24
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: RepoZip ignores context cancellation during filepath.Walk

0 participants