]> asedeno.scripts.mit.edu Git - git.git/blobdiff - builtin-init-db.c
graph API: don't print branch lines for uninteresting merge parents
[git.git] / builtin-init-db.c
index 2854868b4e4185d33024b9fe5d00ad631c18bb36..b061317275792ccb33eea80a5071b72ed6f8d6a7 100644 (file)
@@ -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;
@@ -400,9 +406,16 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
                char buf[10];
                /* We do not spell "group" and such, so that
                 * the configuration can be read by older version
-                * of git.
+                * of git. Note, we use octal numbers for new share modes,
+                * and compatibility values for PERM_GROUP and
+                * PERM_EVERYBODY.
                 */
-               sprintf(buf, "%d", shared_repository);
+               if (shared_repository == PERM_GROUP)
+                       sprintf(buf, "%d", OLD_PERM_GROUP);
+               else if (shared_repository == PERM_EVERYBODY)
+                       sprintf(buf, "%d", OLD_PERM_EVERYBODY);
+               else
+                       sprintf(buf, "0%o", shared_repository);
                git_config_set("core.sharedrepository", buf);
                git_config_set("receive.denyNonFastforwards", "true");
        }