Merge branch 'ps/fsync-refs-fix' into maint-2.39
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:
commit
259988af42
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user