diff options
author | Paul Betts <paul@paulbetts.org> | 2012-02-23 17:11:20 -0800 |
---|---|---|
committer | Paul Betts <paul@paulbetts.org> | 2012-02-23 17:11:20 -0800 |
commit | 1db9d2c3bba2fe95280dca34bc04d261bd5d31f7 (patch) | |
tree | b455b2365af8666d8a1f8ec73c4c4218ea07e534 /tests-clar/diff/blob.c | |
parent | 34ab819ef923c3ff83be44b0c01373e65783b0ab (diff) | |
download | libgit2-1db9d2c3bba2fe95280dca34bc04d261bd5d31f7.tar.gz |
Ensure that commits don't fail if committing content that already exists
Making a commit that results in a blob that already exists in the ODB (i.e.
committing something, then making a revert commit) will result in us trying
to p_rename -> MoveFileExW a temp file into the existing ODB entry. Despite
the MOVEFILE_REPLACE_EXISTING flag is passed in, Win32 does not care and
fails it with STATUS_ACCESS_DENIED.
To fix this, we p_unlink the ODB entry before attempting to rename it. This
call will typically fail, but we don't care, we'll let the p_rename fail if
the file actually does exist and we couldn't delete it for some reason (ACLs,
etc).
Diffstat (limited to 'tests-clar/diff/blob.c')
0 files changed, 0 insertions, 0 deletions