[PATCH v2] git-init: autodetect core.ignorecase
- From
Dmitry Potapov <dpotapov@gmail.com>
- Date
- Mar 25, 2008, 10:49 UTC
- Message-ID
- <20080325104931.GJ25381@dpotapov.dyndns.org>
- In-Reply-To
- <alpine.LSU.1.00.0803251056520.10660@wbgn129.biozentrum.uni-wuerzburg.de>
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> ---
There was a stupid mistake in a previous patch... (Inadvertantly, I sent the old version of my patch, which was incorrect, and did not realize that until saw Johannes' reply to my email.)
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 79eaf8d..62f7c08 100644 --- a/builtin-init-db.c +++ b/builtin-init-db.c @@ -254,8 +254,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)) && @@ -266,6 +266,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;
-- 1.5.5.rc1.10.g3948