use got_path_dirname() in install_blob() to avoid const dirname(3) ok naddy
diff --git a/lib/worktree.c b/lib/worktree.c
index 397a788..5e02cc8 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -1475,10 +1475,12 @@ install_blob(struct got_worktree *worktree, const char *ondisk_path,
GOT_DEFAULT_FILE_MODE);
if (fd == -1) {
if (errno == ENOENT) {
- char *parent = dirname(path);
- if (parent == NULL)
- return got_error_from_errno2("dirname", path);
+ char *parent;
+ err = got_path_dirname(&parent, path);
+ if (err)
+ return err;
err = add_dir_on_disk(worktree, parent);
+ free(parent);
if (err)
return err;
fd = open(ondisk_path,