X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin-init-db.c;h=235a0ee48f2c5ce09c63a949358eb16cde05332d;hb=c56f243e20ce48ae50caf841ada8435a21c2a8bf;hp=7fdd2fa9f9f7fb2801c6e1fc398f78b414a269e1;hpb=1910fe0d7b9f2b1b2ba5d5deb7630d2f90349a96;p=git.git diff --git a/builtin-init-db.c b/builtin-init-db.c index 7fdd2fa9f..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); } @@ -250,7 +250,7 @@ static const char init_db_usage[] = * On the other hand, it might just make lookup slower and messier. You * be the judge. The default case is to have one DB per managed directory. */ -int cmd_init_db(int argc, const char **argv, char **envp) +int cmd_init_db(int argc, const char **argv, const char *prefix) { const char *git_dir; const char *sha1_dir; @@ -267,7 +267,7 @@ int cmd_init_db(int argc, const char **argv, char **envp) 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, char **envp) */ sprintf(buf, "%d", shared_repository); git_config_set("core.sharedrepository", buf); + git_config_set("receive.denyNonFastforwards", "true"); } return 0;