Re: [PATCH] git-init: autodetect core.ignorecase

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Tue, 25 Mar 2008, Dmitry Potapov wrote:

> 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");

Clever!

Last time I checked, the "HEAD" file on VFAT was converted to "head" when 
the repository was initialised on Win32 (IIRC) and read on Linux (IIRC).  
Maybe this problem has gone away, but if not, it should definitely be 
fixed (depending on core.ignorecase).

Ciao,
Dscho

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux