commit - 65ad4e61087e708b8ec592c0ba5fe32955fcdc65
commit + 2a57020b374709058c3f812c2672f8f367ea46fa
blob - c0988d071d4854ceebaab737557de54bd5270fb3
blob + 22ee00ac8d3a6c06298d8e7c068f0d270f3c7c4a
--- lib/worktree.c
+++ lib/worktree.c
if (rename(tmppath, path) != 0) {
err = got_error_from_errno();
+ unlink(tmppath);
goto done;
}
if (rename(merged_path, ondisk_path) != 0) {
err = got_error_from_errno();
+ unlink(merged_path);
goto done;
}
if (update) {
if (rename(tmppath, ondisk_path) != 0) {
err = got_error_from_errno();
+ unlink(tmppath);
goto done;
}
}
if (rename(new_fileindex_path, fileindex_path) != 0) {
err = got_error_from_errno();
+ unlink(new_fileindex_path);
goto done;
}