Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unreleased file handles #37

Open
theseion opened this issue Oct 16, 2015 · 4 comments
Open

Unreleased file handles #37

theseion opened this issue Oct 16, 2015 · 4 comments
Assignees
Labels
Milestone

Comments

@theseion
Copy link
Owner

libgit2 hold on to the file handle for the pack file. This becomes a problem on Windows, where a file can only be (completely) deleted after all handles have been closed.

This may be a problem with objects that aren't properly freed. However, the pack file seems to be the only file with this problem, so the error might actually lie with libgit2 itself.

See:

@theseion theseion added the bug label Oct 16, 2015
@theseion theseion self-assigned this Oct 16, 2015
@theseion theseion added this to the alpha milestone Oct 16, 2015
@tinchodias
Copy link
Collaborator

Interesting. So, this is the reason of the failing tests in Win7.

@theseion
Copy link
Owner Author

That's one reason. The other one is that the DeleteFile function used by FilePlugin to delete files on Windows cannot delete files which have the read-only attribute set. I'm submitting a fix where i try to remove the read-only attribute by calling SetFileAttributes before calling DeleteFile.

@tinchodias
Copy link
Collaborator

Superb. Is the file handle that libgit2 holds to the pack file read-only?

@theseion
Copy link
Owner Author

Probably not. But I haven't had time to dig into libgit2 yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants