Skip to content
Snippets Groups Projects

Clean up partially-downloaded ZIP files if aborted

Created by: mrnugget

This fixes https://github.com/sourcegraph/sourcegraph/issues/15865

This fixes a bug where src-cli would leave partially-downloaded ZIP files behind when the user hit Ctrl-C while a download was ongoing.

The fetchRepositoryArchive would then run into a context-cancelation error when doing the request or the io.Copy and not clean up the file.

The code here checks whether the cause of the error is a cancelation and, if so, cleans up the zip file.

Merge request reports

Approval is optional

Merged by avatar (Jul 29, 2025 8:56am UTC)

Merge details

  • Changes merged into main with eddca807.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading