git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] git-init: autodetect core.ignorecase
@ 2008-05-11 16:16 Steffen Prohaska
  2008-05-11 16:16 ` [PATCH 2/4] t0050: Test " Steffen Prohaska
  2008-05-11 16:21 ` [PATCH 0/4] core.ignorecase Steffen Prohaska
  0 siblings, 2 replies; 6+ messages in thread
From: Steffen Prohaska @ 2008-05-11 16:16 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Linus Torvalds, Dmitry Potapov, Steffen Prohaska

From: Dmitry Potapov <dpotapov@gmail.com>

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>
---
 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 2854868..3721bd2 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;
-- 
1.5.5.1.313.g9decb

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-05-11 17:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-11 16:16 [PATCH 1/4] git-init: autodetect core.ignorecase Steffen Prohaska
2008-05-11 16:16 ` [PATCH 2/4] t0050: Test " Steffen Prohaska
2008-05-11 16:16   ` [PATCH 3/4] t0050: Set core.ignorecase case to activate case insensitivity Steffen Prohaska
2008-05-11 16:16     ` [PATCH 4/4] t0050: Add test for case insensitive add Steffen Prohaska
2008-05-11 17:10     ` [PATCH 3/4] t0050: Set core.ignorecase case to activate case insensitivity Linus Torvalds
2008-05-11 16:21 ` [PATCH 0/4] core.ignorecase Steffen Prohaska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).