mirror of
https://github.com/git/git.git
synced 2024-11-27 20:14:30 +08:00
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:
commit
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),
|
||||
|
Loading…
Reference in New Issue
Block a user