summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b8a9733)
raw | patch | inline | side by side (parent: b8a9733)
author | Ramsay Jones <ramsay@ramsay1.demon.co.uk> | |
Thu, 16 Jun 2011 20:23:14 +0000 (21:23 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 16 Jun 2011 22:10:54 +0000 (15:10 -0700) |
The 'forced modes' test fails on cygwin because the post-update
hook loses it's executable bit when copied from the templates
directory by git-init. The template loses it's executable bit
because the lstat() function resolves to the "native Win32 API"
implementation.
This call to lstat() happens after git-init has set the "git_dir"
(so has_git_dir() returns true), but before the configuration has
been fully initialised. At this point git_config() does not find
any config files to parse and returns 0. Unfortunately, the code
used to determine the cygwin l/stat() function bindings did not
check the return from git_config() and assumed that the config
was complete and accessible once "git_dir" was set.
In order to fix the test, we simply change the binding code to
test the return value from git_config(), to ensure that it actually
had config values to read, before determining the requested binding.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
hook loses it's executable bit when copied from the templates
directory by git-init. The template loses it's executable bit
because the lstat() function resolves to the "native Win32 API"
implementation.
This call to lstat() happens after git-init has set the "git_dir"
(so has_git_dir() returns true), but before the configuration has
been fully initialised. At this point git_config() does not find
any config files to parse and returns 0. Unfortunately, the code
used to determine the cygwin l/stat() function bindings did not
check the return from git_config() and assumed that the config
was complete and accessible once "git_dir" was set.
In order to fix the test, we simply change the binding code to
test the return value from git_config(), to ensure that it actually
had config values to read, before determining the requested binding.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/cygwin.c | patch | blob | history |
diff --git a/compat/cygwin.c b/compat/cygwin.c
index b4a51b958c5651d3b509013aaef0c4e30b68a816..b38dbd7f8fb557b3cf70aef29ec173afc106d5fc 100644 (file)
--- a/compat/cygwin.c
+++ b/compat/cygwin.c
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;