summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorLibravatar Dmitry Potapov <dpotapov@gmail.com>2008-09-30 17:53:47 +0400
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2008-09-30 14:30:06 -0700
commitadbc0b6b6e57c11ca49779d01f549260a920a97d (patch)
treee2e7f5552e8a0b0775a11acc57eea69d04fe364f /diff.c
parentmingw: move common functionality to win32.h (diff)
downloadtgif-adbc0b6b6e57c11ca49779d01f549260a920a97d.tar.xz
cygwin: Use native Win32 API for stat
lstat/stat functions in Cygwin are very slow, because they try to emulate some *nix things that Git does not actually need. This patch adds Win32 specific implementation of these functions for Cygwin. This implementation handles most situation directly but in some rare cases it falls back on the implementation provided for Cygwin. This is necessary for two reasons: - Cygwin has its own file hierarchy, so absolute paths used in Cygwin is not suitable to be used Win32 API. cygwin_conv_to_win32_path can not be used because it automatically dereference Cygwin symbol links, also it causes extra syscall. Fortunately Git rarely use absolute paths, so we always use Cygwin implementation for absolute paths. - Support of symbol links. Cygwin stores symbol links as ordinary using one of two possible formats. Therefore, the fast implementation falls back to Cygwin functions if it detects potential use of symbol links. The speed of this implementation should be the same as mingw_lstat for common cases, but it is considerable slower when the specified file name does not exist. Despite all efforts to make the fast implementation as robust as possible, it may not work well for some very rare situations. I am aware only one situation: use Cygwin mount to bind unrelated paths inside repository together. Therefore, the core.ignoreCygwinFSTricks configuration option is provided, which controls whether native or Cygwin version of stat is used. Signed-off-by: Dmitry Potapov <dpotapov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'diff.c')
0 files changed, 0 insertions, 0 deletions