X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-init-db.c;h=235a0ee48f2c5ce09c63a949358eb16cde05332d;hb=9b8dc263e1b0d470cc67a824837d8884ae3e7136;hp=52473edf569e4d318a74548acefaf4023f37c87c;hpb=a633fca0c056aa221d23493c276d3713191621b3;p=git.git diff --git a/builtin-init-db.c b/builtin-init-db.c index 52473edf5..235a0ee48 100644 --- a/builtin-init-db.c +++ b/builtin-init-db.c @@ -218,8 +218,8 @@ static void create_default_files(const char *git_dir, const char *template_path) * branch, if it does not exist yet. */ strcpy(path + len, "HEAD"); - if (read_ref(path, sha1) < 0) { - if (create_symref(path, "refs/heads/master") < 0) + if (read_ref("HEAD", sha1) < 0) { + if (create_symref("HEAD", "refs/heads/master") < 0) exit(1); } @@ -267,7 +267,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix) else if (!strncmp(arg, "--shared=", 9)) shared_repository = git_config_perm("arg", arg+9); else - die(init_db_usage); + usage(init_db_usage); } /* @@ -311,6 +311,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix) */ sprintf(buf, "%d", shared_repository); git_config_set("core.sharedrepository", buf); + git_config_set("receive.denyNonFastforwards", "true"); } return 0;