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

reftable-files locked and can't unlink by cgit (on windows) #101

Open
zotttelbart opened this issue Oct 20, 2024 · 0 comments
Open

reftable-files locked and can't unlink by cgit (on windows) #101

zotttelbart opened this issue Oct 20, 2024 · 0 comments

Comments

@zotttelbart
Copy link

Version

7.0.0

Operating System

Windows

Bug description

In FileReftableStack.reloadOnce all files which are listed in tables.list are open by FileInputStream. This causes unlink errors in other processes under windows(e.g. git-bash).

Actual behavior

Start a java process which uses jgit to open a Repository and hold the process before git.close(). For example with debugger, or by waiting for input.

In the same time, go to git bash and create a new ref.

example:
git update-ref refs/tags/test 939d321faccd12bff4cb13ce6358820297fbc78e

then pack the reftable by

git pack-refs

you should get something like:

Unlink of file 'C:/temp/jgit/.git/reftable/0x000000000001-0x000000000007-43471c5d.ref' failed. Should I try again? (y/n)

Expected behavior

The files of the reftable should not be locked until git.close(). It should only be locked by FileInputStream, if reads of reftable in jgit is neccessary.

If the read of an ref-files failed (because it was deleted), jgit should reread the tables.list file.

Relevant log output

No response

Other information

Sorry for my poor english. I hope, you understand my problem ;)

@zotttelbart zotttelbart changed the title reftable-files locked and can't unlink by cgit reftable-files locked and can't unlink by cgit (on windows) Oct 20, 2024
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

No branches or pull requests

1 participant