X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=compat%2Fcygwin.c;h=b4a51b958c5651d3b509013aaef0c4e30b68a816;hb=d8308c79fc2cae2d1891f92b9e0f9ec0361fe7df;hp=ebac1483929c798905e6558e0013e3de3d6abeb2;hpb=0d5055665ca1e76659ffa96bf972b4b0125ea069;p=git.git diff --git a/compat/cygwin.c b/compat/cygwin.c index ebac14839..dfe9b3084 100644 --- a/compat/cygwin.c +++ b/compat/cygwin.c @@ -89,10 +89,10 @@ static int cygwin_stat(const char *path, struct stat *buf) /* * At start up, we are trying to determine whether Win32 API or cygwin stat * functions should be used. The choice is determined by core.ignorecygwinfstricks. - * Reading this option is not always possible immediately as git_dir may be + * Reading this option is not always possible immediately as git_dir may * not be set yet. So until it is set, use cygwin lstat/stat functions. * However, if core.filemode is set, we must use the Cygwin posix - * stat/lstat as the Windows stat fuctions do not determine posix filemode. + * stat/lstat as the Windows stat functions do not determine posix filemode. * * Note that git_cygwin_config() does NOT call git_default_config() and this * is deliberate. Many commands read from config to establish initial @@ -101,7 +101,7 @@ static int cygwin_stat(const char *path, struct stat *buf) * and calling git_default_config() from here would break such variables. */ static int native_stat = 1; -static int core_filemode; +static int core_filemode = 1; /* matches trust_executable_bit default */ static int git_cygwin_config(const char *var, const char *value, void *cb) { @@ -114,8 +114,7 @@ static int git_cygwin_config(const char *var, const char *value, void *cb) static int init_stat(void) { - if (have_git_dir()) { - git_config(git_cygwin_config, NULL); + if (have_git_dir() && git_config(git_cygwin_config,NULL)) { if (!core_filemode && native_stat) { cygwin_stat_fn = cygwin_stat; cygwin_lstat_fn = cygwin_lstat;