commit - a51a74b38b5e1f44f2967ff4e43e5a4485a13c7a
commit + 8dc303ccb46a3b17a7276fb5597fed2a6eee2a1f
blob - b40be459fb8d284670deee511cf74e3860060e99
blob + 59a5e820c09d0781286104cfdf959335e2b09099
--- lib/worktree.c
+++ lib/worktree.c
char *ondisk_path = NULL;
if (asprintf(&ondisk_path, "%s%s%s",
- worktree->root_path, path[0] ? "/" : "", path) == -1) {
- err = got_error_from_errno("asprintf");
- goto done;
- }
+ worktree->root_path, path[0] ? "/" : "", path) == -1)
+ return got_error_from_errno("asprintf");
+
workdir = opendir(ondisk_path);
if (workdir == NULL) {
if (errno != ENOTDIR && errno != ENOENT)
err = got_fileindex_diff_dir(fileindex, workdir,
worktree->root_path, path, repo, &fdiff_cb, &arg);
}
-done:
+
if (workdir)
closedir(workdir);
free(ondisk_path);