Commit Diff


commit - ef68ca6f52da8c840d10d8c483c77fcac614c371
commit + b15bc87b1884e0d5a69df4536d29a8a8af8a745b
blob - 7ac3e89d86dfc8200ca59cddc8111ae2105b4611
blob + be2544b20e495c1e8e6ec3d59412f2024401e94a
--- lib/worktree.c
+++ lib/worktree.c
@@ -1006,8 +1006,10 @@ install_symlink(struct got_worktree *worktree, const c
 	 */
 	resolved_path = realpath(abspath ? abspath : target_path, NULL);
 	if (resolved_path == NULL) {
-		if (errno != ENOENT)
-			return got_error_from_errno2("realpath", target_path);
+		if (errno != ENOENT) {
+			err = got_error_from_errno2("realpath", target_path);
+			goto done;
+		}
 	}
 
 	/* Only allow symlinks pointing at paths within the work tree. */