Merge branch 'sg/travis-retrieve-trash-upon-failure'
[gitweb.git] / builtin / init-db.c
index 2542c5244e91b68692c7ed371fa9976997ee8ff5..12ddda7e7bac51f74b2f7ca8a2b64ffe90fd8683 100644 (file)
@@ -73,7 +73,8 @@ static void copy_templates_1(struct strbuf *path, struct strbuf *template_path,
                        continue;
                else if (S_ISLNK(st_template.st_mode)) {
                        struct strbuf lnk = STRBUF_INIT;
-                       if (strbuf_readlink(&lnk, template_path->buf, 0) < 0)
+                       if (strbuf_readlink(&lnk, template_path->buf,
+                                           st_template.st_size) < 0)
                                die_errno(_("cannot readlink '%s'"), template_path->buf);
                        if (symlink(lnk.buf, path->buf))
                                die_errno(_("cannot symlink '%s' '%s'"),
@@ -117,7 +118,7 @@ static void copy_templates(const char *template_dir)
 
        dir = opendir(template_path.buf);
        if (!dir) {
-               warning(_("templates not found %s"), template_dir);
+               warning(_("templates not found in %s"), template_dir);
                goto free_return;
        }
 
@@ -391,7 +392,7 @@ int init_db(const char *git_dir, const char *real_git_dir,
                else if (get_shared_repository() == PERM_EVERYBODY)
                        xsnprintf(buf, sizeof(buf), "%d", OLD_PERM_EVERYBODY);
                else
-                       die("BUG: invalid value for shared_repository");
+                       BUG("invalid value for shared_repository");
                git_config_set("core.sharedrepository", buf);
                git_config_set("receive.denyNonFastforwards", "true");
        }