diff options
author | Dmitry Potapov <dpotapov@gmail.com> | 2008-05-11 18:16:39 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-05-11 11:31:28 -0700 |
commit | 2455406ab1b0e2b0ad9e5273b9aef6c739d5b8fe (patch) | |
tree | b89f452766d0a6824a66da750fd8c3d0f1578e5d /builtin-init-db.c | |
parent | 1f8115b113def8ee03701aa87b26c5e8b7c94434 (diff) | |
download | git-2455406ab1b0e2b0ad9e5273b9aef6c739d5b8fe.tar.gz |
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>
Diffstat (limited to 'builtin-init-db.c')
-rw-r--r-- | builtin-init-db.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin-init-db.c b/builtin-init-db.c index a76f5d3474..b061317275 100644 --- a/builtin-init-db.c +++ b/builtin-init-db.c @@ -255,8 +255,8 @@ static int create_default_files(const char *git_dir, const char *template_path) git_config_set("core.worktree", work_tree); } - /* Check if symlink is supported in the work tree */ if (!reinit) { + /* Check if symlink is supported in the work tree */ path[len] = 0; strcpy(path + len, "tXXXXXX"); if (!close(xmkstemp(path)) && @@ -267,6 +267,12 @@ static int create_default_files(const char *git_dir, const char *template_path) unlink(path); /* good */ else 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; |