setup: allow for prefix to be passed to git commands
[gitweb.git] / worktree.c
index d4606aa8cd5ab476599a2f91f9d96ae03389fbab..d633761575bff4811fa4f3f3822807b1f77f5ecb 100644 (file)
@@ -145,7 +145,7 @@ static struct worktree *get_linked_worktree(const char *id)
 
 static void mark_current_worktree(struct worktree **worktrees)
 {
-       char *git_dir = xstrdup(absolute_path(get_git_dir()));
+       char *git_dir = absolute_pathdup(get_git_dir());
        int i;
 
        for (i = 0; worktrees[i]; i++) {
@@ -255,7 +255,7 @@ struct worktree *find_worktree(struct worktree **list,
                return wt;
 
        arg = prefix_filename(prefix, strlen(prefix), arg);
-       path = xstrdup(real_path(arg));
+       path = real_pathdup(arg);
        for (; *list; list++)
                if (!fspathcmp(path, real_path((*list)->path)))
                        break;
@@ -387,7 +387,7 @@ int submodule_uses_worktrees(const char *path)
        struct strbuf sb = STRBUF_INIT;
        DIR *dir;
        struct dirent *d;
-       int ret;
+       int ret = 0;
        struct repository_format format;
 
        submodule_gitdir = git_pathdup_submodule(path, "%s", "");