Le 11/10/2018 à 15:51, Phillip Wood a écrit :
On 07/10/2018 20:54, Alban Gruin wrote:
quoted
+ if (rewrite_file(todo_file, new_todo.buf.buf, new_todo.buf.len) <
0) {
+ todo_list_release(&new_todo);
+ return error_errno(_("could not write '%s'"), todo_file);
+ }
rewrite_file() can truncate the old version of the file if there is an
error when writing the new version, I think it would be better to use
write_message() instead as that atomically updates the file. The same
applies to patch 5 (refactor rearrange_squash()) after which I think
there will be no callers to rewrite_file() so it can be deleted.
You’re right, I didn’t notice that.
Best Wishes
Phillip
Cheers,
Alban