@matheusbsbs / matheus-bagliano / commits / 2455406ab1
Fork 0

git-init: autodetect core.ignorecase

We already detect if symbolic links are supported by the filesystem. This patch adds autodetect for case-insensitive filesystems, such as VFAT and others. Signed-off-by: Dmitry Potapov <dpotapov@gmail.com> Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Dmitry Potapov committed May 11, 2008 at 18:16 UTC 2455406ab1b0e2b0ad9e5273b9aef6c739d5b8fe
1 file changed +7 -1
builtin-init-db.c
+7 -1
@@ -255,8 +255,8 @@ static int create_default_files(const char *git_dir, const char *template_path)
255 git_config_set("core.worktree", work_tree);
256 }
257
258 - /* Check if symlink is supported in the work tree */
258 if (!reinit) {
259 + /* Check if symlink is supported in the work tree */
260 path[len] = 0;
261 strcpy(path + len, "tXXXXXX");
262 if (!close(xmkstemp(path)) &&
@@ -267,6 +267,12 @@ static int create_default_files(const char *git_dir, const char *template_path)
267 unlink(path); /* good */
268 else
269 git_config_set("core.symlinks", "false");
270 +
271 + /* Check if the filesystem is case-insensitive */
272 + path[len] = 0;
273 + strcpy(path + len, "CoNfIg");
274 + if (!access(path, F_OK))
275 + git_config_set("core.ignorecase", "true");
276 }
277
278 return reinit;