Commit 4b33b1ad1fe5ff5fb075ffaccaa7d631746951a6

Stefan Sperling 2019-07-22T10:29:59

remove redundant existence check in 'got add'; 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 0b15a8b..5849b2a 100644
--- a/got/got.c
+++ b/got/got.c
@@ -2822,16 +2822,6 @@ cmd_add(int argc, char *argv[])
 	if (argc < 1)
 		usage_add();
 
-	/* make sure each file exists before doing anything halfway */
-	for (x = 0; x < argc; x++) {
-		char *path = realpath(argv[x], NULL);
-		if (path == NULL) {
-			error = got_error_from_errno2("realpath", argv[x]);
-			goto done;
-		}
-		free(path);
-	}
-
 	cwd = getcwd(NULL, 0);
 	if (cwd == NULL) {
 		error = got_error_from_errno("getcwd");