]> git.lizzy.rs Git - plan9front.git/commitdiff
git/fetch: ensure we clean packfiles on failure
authorOri Bernstein <ori@eigenstate.org>
Sat, 17 Jul 2021 00:10:44 +0000 (00:10 +0000)
committerOri Bernstein <ori@eigenstate.org>
Sat, 17 Jul 2021 00:10:44 +0000 (00:10 +0000)
When pulling into a git repository that is group
writable as a non-owner, the pack file is left
in place because we do not have permission to
remove it.

We also leave it behind if we bail out early due
to an error, or due to only listing the changes.

This pushes down the creation of the file, and
cleans it up on error.

thanks to Anthony Martin for spotting the bug.
git/fetch: ensure we clean packfiles on failure

When pulling into a git repository that is group
writable as a non-owner, the pack file is left
in place because we do not have permission to
remove it.

We also leave it behind if we bail out early due
to an error, or due to only listing the changes.

This pushes down the creation of the file, and
cleans it up on error.

Also, while we're here, clean up index caching,
and ensure we close the fd in all cases.

thanks to Anthony Martin for spotting the bug.


No differences found