Commit Diff


commit - 237cfda12ceeaf6741ae34b166118631ffd35a80
commit + 8f83a2643c211f21ec5731e80ebcb6218f7c6689
blob - c246bc2ddfac03461f12f26e9b5773620c4e525b
blob + 3454ef5b7d94ce34d945b2c25782176e12ddf8cc
--- got/got.c
+++ got/got.c
@@ -4562,22 +4562,6 @@ cmd_diff(int argc, char *argv[])
 				goto done;
 			}
 		} else {
-			repo_path = strdup(cwd);
-			if (repo_path == NULL) {
-				error = got_error_from_errno("strdup");
-				goto done;
-			}
-		}
-	}
-
-	if (worktree) {
-		repo_path = strdup(got_worktree_get_repo_path(worktree));
-		if (repo_path == NULL) {
-			error = got_error_from_errno("strdup");
-			goto done;
-		}
-	} else {
-		if (repo_path == NULL) {
 			repo_path = strdup(cwd);
 			if (repo_path == NULL) {
 				error = got_error_from_errno("strdup");