зеркало из https://github.com/microsoft/git.git
Merge branch 'ps/fsync-refs-fix'
Fix the sequence to fsync $GIT_DIR/packed-refs file that forgot to flush its output to the disk.. * ps/fsync-refs-fix: refs: fix corruption by not correctly syncing packed-refs to disk
This commit is contained in:
Коммит
3ed91c5f22
|
@ -1263,7 +1263,8 @@ static int write_with_updates(struct packed_ref_store *refs,
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (fsync_component(FSYNC_COMPONENT_REFERENCE, get_tempfile_fd(refs->tempfile)) ||
|
||||
if (fflush(out) ||
|
||||
fsync_component(FSYNC_COMPONENT_REFERENCE, get_tempfile_fd(refs->tempfile)) ||
|
||||
close_tempfile_gently(refs->tempfile)) {
|
||||
strbuf_addf(err, "error closing file %s: %s",
|
||||
get_tempfile_path(refs->tempfile),
|
||||
|
|
Загрузка…
Ссылка в новой задаче