refs/packed-backend.c: close fd of empty file
Signed-off-by: Stefan Beller <sbeller@google.com> Acked-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
2161ed8098
commit
09427e8366
@ -499,6 +499,7 @@ static int load_contents(struct snapshot *snapshot)
|
||||
size = xsize_t(st.st_size);
|
||||
|
||||
if (!size) {
|
||||
close(fd);
|
||||
return 0;
|
||||
} else if (mmap_strategy == MMAP_NONE || size <= SMALL_FILE_SIZE) {
|
||||
snapshot->buf = xmalloc(size);
|
||||
|
Loading…
Reference in New Issue
Block a user