]> git.ipfire.org Git - thirdparty/git.git/blobdiff - worktree.c
Merge branch 'ao/submodule-wo-gitmodules-checked-out'
[thirdparty/git.git] / worktree.c
index 97cda5f97bbc10b2f5690b945ab42d2beef74e2e..befdbe7faef37d8ae1d4a3de896e37fade2f4862 100644 (file)
@@ -217,7 +217,11 @@ struct worktree *find_worktree(struct worktree **list,
 
        if (prefix)
                arg = to_free = prefix_filename(prefix, arg);
-       path = real_pathdup(arg, 1);
+       path = real_pathdup(arg, 0);
+       if (!path) {
+               free(to_free);
+               return NULL;
+       }
        for (; *list; list++)
                if (!fspathcmp(path, real_path((*list)->path)))
                        break;
@@ -231,7 +235,7 @@ int is_main_worktree(const struct worktree *wt)
        return !wt->id;
 }
 
-const char *is_worktree_locked(struct worktree *wt)
+const char *worktree_lock_reason(struct worktree *wt)
 {
        assert(!is_main_worktree(wt));