Commit f528b57d8841d4669cc7879f9a46e7787d1f1dfc

Stefan Sperling 2019-07-22T10:31:32

remove redundant existence check in 'got rm'; same check is done later

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/got/got.c b/got/got.c
index 5849b2a..0cc9e66 100644
--- a/got/got.c
+++ b/got/got.c
@@ -2911,16 +2911,6 @@ cmd_remove(int argc, char *argv[])
 	if (argc < 1)
 		usage_remove();
 
-	/* make sure each file exists before doing anything halfway */
-	for (i = 0; i < argc; i++) {
-		char *path = realpath(argv[i], NULL);
-		if (path == NULL) {
-			error = got_error_from_errno2("realpath", argv[i]);
-			goto done;
-		}
-		free(path);
-	}
-
 	cwd = getcwd(NULL, 0);
 	if (cwd == NULL) {
 		error = got_error_from_errno("getcwd");