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>
This commit is contained in:
Dmitry Potapov 2008-05-11 18:16:39 +02:00 коммит произвёл Junio C Hamano
Родитель 1f8115b113
Коммит 2455406ab1
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -255,8 +255,8 @@ static int create_default_files(const char *git_dir, const char *template_path)
git_config_set("core.worktree", work_tree); git_config_set("core.worktree", work_tree);
} }
/* Check if symlink is supported in the work tree */
if (!reinit) { if (!reinit) {
/* Check if symlink is supported in the work tree */
path[len] = 0; path[len] = 0;
strcpy(path + len, "tXXXXXX"); strcpy(path + len, "tXXXXXX");
if (!close(xmkstemp(path)) && if (!close(xmkstemp(path)) &&
@ -267,6 +267,12 @@ static int create_default_files(const char *git_dir, const char *template_path)
unlink(path); /* good */ unlink(path); /* good */
else else
git_config_set("core.symlinks", "false"); git_config_set("core.symlinks", "false");
/* Check if the filesystem is case-insensitive */
path[len] = 0;
strcpy(path + len, "CoNfIg");
if (!access(path, F_OK))
git_config_set("core.ignorecase", "true");
} }
return reinit; return reinit;