]> git.ipfire.org Git - thirdparty/git.git/commit - entry.c
write_entry(): use fstat() instead of lstat() when file is open
authorKjetil Barvik <barvik@broadpark.no>
Mon, 9 Feb 2009 20:54:51 +0000 (21:54 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 10 Feb 2009 04:59:26 +0000 (20:59 -0800)
commite4c7292353dbef39feac1c6a60c5cde9140520a6
treea7f66ac7391e445cd14cbf04caac2971db780bb1
parent4857c761e35b07c12ff2ef1140e93b071b8ac4e7
write_entry(): use fstat() instead of lstat() when file is open

Currently inside write_entry() we do an lstat(path, &st) call on a
file which have just been opened inside the exact same function.  It
should be better to call fstat(fd, &st) on the file while it is open,
and it should be at least as fast as the lstat() method.

Signed-off-by: Kjetil Barvik <barvik@broadpark.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
entry.c