Skip to content

storage: filesystem, close packfile iterators after use#2027

Merged
pjbgf merged 1 commit into
go-git:mainfrom
aymanbagabas:file-leaks
Apr 27, 2026
Merged

storage: filesystem, close packfile iterators after use#2027
pjbgf merged 1 commit into
go-git:mainfrom
aymanbagabas:file-leaks

Conversation

@aymanbagabas

Copy link
Copy Markdown
Member

This fixes some leaks of file descriptors when iterating over packfiles. The packfile iterators are now closed after use, and the file descriptor is closed if an error occurs while creating the zlib reader.

Related: https://github.com/go-git/go-git/actions/runs/24908334127/job/72949435719?pr=1987

@pjbgf pjbgf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@aymanbagabas thanks for working on this. 🙇

This fixes some leaks of file descriptors when iterating over packfiles.
The packfile iterators are now closed after use, and the file descriptor
is closed if an error occurs while creating the zlib reader.

Related: https://github.com/go-git/go-git/actions/runs/24908334127/job/72949435719?pr=1987
Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>
@pjbgf pjbgf merged commit 19e491d into go-git:main Apr 27, 2026
17 checks passed
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