{"thread":{"id":"33182","subject":"[PATCH] Make core.sharedRepository work under cygwin 1.7","startedAt":"2013-03-14T16:01:38Z","lastAt":"2013-03-14T16:01:38Z","messageCount":1,"participants":["Torsten Bögershausen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"211308","messageId":"201303141701.39215.tboegi@web.de","threadId":"33182","inReplyTo":null,"subject":"[PATCH] Make core.sharedRepository work under cygwin 1.7","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2013-03-14T16:01:38Z","receivedAt":"2013-03-14T16:01:38Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"When core.sharedRepository is used, set_shared_perm() in path.c\nneeds lstat() to return the correct POSIX permissions.\n\nThe default for cygwin is core.ignoreCygwinFSTricks = false, which\nmeans that a simplified and fast implementation of lstat() is used.\n\nEspecially the file permission bits are wrong in cygwin_lstat_fn():\nThe read-only attribute of a file is used to calculate\nthe permissions, resulting in either rw-r--r-- or r--r--r--\n\nUse a compile switch IGNORECYGWINFSTRICKS to disable the usage\nof cygwin_lstat_fn() only in path.c\n\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\n compat/cygwin.h | 2 ++\n path.c          | 2 ++\n 2 files changed, 4 insertions(+)\n\ndiff --git a/compat/cygwin.h b/compat/cygwin.h\nindex a3229f5..984efbe 100644\n--- a/compat/cygwin.h\n+++ b/compat/cygwin.h\n@@ -5,5 +5,7 @@ typedef int (*stat_fn_t)(const char*, struct stat*);\n extern stat_fn_t cygwin_stat_fn;\n extern stat_fn_t cygwin_lstat_fn;\n \n+#ifndef IGNORECYGWINFSTRICKS\n #define stat(path, buf) (*cygwin_stat_fn)(path, buf)\n #define lstat(path, buf) (*cygwin_lstat_fn)(path, buf)\n+#endif\ndiff --git a/path.c b/path.c\nindex d3d3f8b..0acfabf 100644\n--- a/path.c\n+++ b/path.c\n@@ -10,6 +10,8 @@\n  *\n  * which is what it's designed for.\n  */\n+#define IGNORECYGWINFSTRICKS\n+\n #include \"cache.h\"\n #include \"strbuf.h\"\n #include \"string-list.h\"\n-- \n1.8.1.3\n"}]}