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

git clone --dissociate reports "Unlink of file failed" errors #446

Closed
Radrik5 opened this issue Sep 28, 2015 · 2 comments
Closed

git clone --dissociate reports "Unlink of file failed" errors #446

Radrik5 opened this issue Sep 28, 2015 · 2 comments

Comments

@Radrik5
Copy link

Radrik5 commented Sep 28, 2015

I'm using Git 2.5.3 64 bit on Windows 7.

MCVE:

unlink_test $ git clone -b maint-1.9 --single-branch --bare git@github.com:git-for-windows/git.git git_source.git
Cloning into bare repository 'git_source.git'...
remote: Counting objects: 193111, done.
remote: Compressing objects: 100% (32/32), done.
remote: Total 193111 (delta 1), reused 32 (delta 1), pack-reused 193078
Receiving objects: 100% (193111/193111), 54.46 MiB | 47.00 KiB/s, done.
Resolving deltas: 100% (141871/141871), done.
Checking connectivity... done.

unlink_test $ git clone --bare --reference git_source.git --dissociate git@github.com:git-for-windows/git.git git.git
Cloning into bare repository 'git.git'...
remote: Counting objects: 31235, done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 31235 (delta 10218), reused 10211 (delta 10211), pack-reused 21007
Receiving objects: 100% (31235/31235), 17.83 MiB | 65.00 KiB/s, done.
Resolving deltas: 100% (22281/22281), completed with 1229 local objects.
Checking connectivity... done.
Counting objects: 224346, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (59077/59077), done.
Writing objects: 100% (224346/224346), done.
Total 224346 (delta 165973), reused 221705 (delta 163332)
Unlink of file 'E:/Projects/unlink_test/git.git/objects/pack/pack-25bee3702a49b141b3a66f56a4397551f1ed4688.pack' failed. Should I try again? (y/n)
Unlink of file 'E:/Projects/unlink_test/git.git/objects/pack/pack-25bee3702a49b141b3a66f56a4397551f1ed4688.idx' failed. Should I try again? (y/n)
@dscho
Copy link
Member

dscho commented Sep 28, 2015

Thanks. This MCVE really helps me!

BTW you can reproduce the same issue with smaller repositories, and local repositories are sufficient, too, no need to connect to GitHub ;-)

@dscho dscho closed this as completed in a797af4 Sep 28, 2015
gitster pushed a commit to git/git that referenced this issue Sep 28, 2015
When `git clone` is asked to dissociate the repository from the
reference repository whose objects were used, it is quite possible that
the pack files need to be repacked. In that case, the pack files need to
be deleted that were originally hard-links to the reference repository's
pack files.

On platforms where a file cannot be deleted if another process still
holds a handle on it, we therefore need to take pains to release all
pack files and indexes before dissociating.

This fixes git-for-windows#446

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
@Radrik5
Copy link
Author

Radrik5 commented Sep 29, 2015

Thanks a lot for quick fix!

dscho added a commit to dscho/git that referenced this issue Sep 29, 2015
When `git clone` is asked to dissociate the repository from the
reference repository whose objects were used, it is quite possible that
the pack files need to be repacked. In that case, the pack files need to
be deleted that were originally hard-links to the reference repository's
pack files.

On platforms where a file cannot be deleted if another process still
holds a handle on it, we therefore need to take pains to release all
pack files and indexes before dissociating.

This fixes git-for-windows#446

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/git that referenced this issue Oct 5, 2015
When `git clone` is asked to dissociate the repository from the
reference repository whose objects were used, it is quite possible that
the pack files need to be repacked. In that case, the pack files need to
be deleted that were originally hard-links to the reference repository's
pack files.

On platforms where a file cannot be deleted if another process still
holds a handle on it, we therefore need to take pains to release all
pack files and indexes before dissociating.

This fixes git-for-windows#446

The test case to demonstrate the breakage technically does not need to
be run on Linux or MacOSX. It won't hurt, either, though.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this issue Oct 5, 2015
When `git clone` is asked to dissociate the repository from the
reference repository whose objects were used, it is quite possible that
the pack files need to be repacked. In that case, the pack files need to
be deleted that were originally hard-links to the reference repository's
pack files.

On platforms where a file cannot be deleted if another process still
holds a handle on it, we therefore need to take pains to release all
pack files and indexes before dissociating.

This fixes #446

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
gitster pushed a commit to git/git that referenced this issue Oct 5, 2015
When `git clone` is asked to dissociate the repository from the
reference repository whose objects were used, it is quite possible that
the pack files need to be repacked. In that case, the pack files need to
be deleted that were originally hard-links to the reference repository's
pack files.

On platforms where a file cannot be deleted if another process still
holds a handle on it, we therefore need to take pains to release all
pack files and indexes before dissociating.

This fixes git-for-windows#446

The test case to demonstrate the breakage technically does not need to
be run on Linux or MacOSX. It won't hurt, either, though.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dscho added a commit to dscho/git that referenced this issue Oct 6, 2015
When `git clone` is asked to dissociate the repository from the
reference repository whose objects were used, it is quite possible that
the pack files need to be repacked. In that case, the pack files need to
be deleted that were originally hard-links to the reference repository's
pack files.

On platforms where a file cannot be deleted if another process still
holds a handle on it, we therefore need to take pains to release all
pack files and indexes before dissociating.

This fixes git-for-windows#446

The test case to demonstrate the breakage technically does not need to
be run on Linux or MacOSX. It won't hurt, either, though.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
gitster pushed a commit to git/git that referenced this issue Oct 7, 2015
When `git clone` is asked to dissociate the repository from the
reference repository whose objects were used, it is quite possible that
the pack files need to be repacked. In that case, the pack files need to
be deleted that were originally hard-links to the reference repository's
pack files.

On platforms where a file cannot be deleted if another process still
holds a handle on it, we therefore need to take pains to release all
pack files and indexes before dissociating.

This fixes git-for-windows#446

The test case to demonstrate the breakage technically does not need to
be run on Linux or MacOSX. It won't hurt, either, though.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dscho added a commit to dscho/git that referenced this issue Oct 18, 2015
When `git clone` is asked to dissociate the repository from the
reference repository whose objects were used, it is quite possible that
the pack files need to be repacked. In that case, the pack files need to
be deleted that were originally hard-links to the reference repository's
pack files.

On platforms where a file cannot be deleted if another process still
holds a handle on it, we therefore need to take pains to release all
pack files and indexes before dissociating.

This fixes git-for-windows#446

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/git that referenced this issue Oct 18, 2015
When `git clone` is asked to dissociate the repository from the
reference repository whose objects were used, it is quite possible that
the pack files need to be repacked. In that case, the pack files need to
be deleted that were originally hard-links to the reference repository's
pack files.

On platforms where a file cannot be deleted if another process still
holds a handle on it, we therefore need to take pains to release all
pack files and indexes before dissociating.

This fixes git-for-windows#446

The test case to demonstrate the breakage technically does not need to
be run on Linux or MacOSX. It won't hurth, either, though.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants