Re: [PATCH 7/8] Provide API access to init_db()
Daniel Barkalow <barkalow@iabervon.org> writes:
> ...
> + * PERM_EVERYBODY.
> + */
> + sprintf(buf, "%d", shared_repository);
This line is superfluous (no need to send amended patch).
> + if (shared_repository == PERM_GROUP)
> + sprintf(buf, "%d", OLD_PERM_GROUP);
> ...
Show 10 quoted lines
> + if (is_bare_repository_cfg < 0)
> + is_bare_repository_cfg = guess_repository_type(git_dir);
> +
> + if (!is_bare_repository_cfg) {
> + if (git_dir) {
> + const char *git_dir_parent = strrchr(git_dir, '/');
> + if (git_dir_parent) {
> + char *rel = xstrndup(git_dir, git_dir_parent - git_dir);
> + git_work_tree_cfg = xstrdup(make_absolute_path(rel));
> + free(rel);Good change to plug a leak and make the code easier to read..