Commit 8fa913ec61095de669c9ca40e3cd782d53c85bdc

Stefan Sperling 2020-11-14T13:19:18

remove now pointless 'check_disk' parameter of got_repo_map_path() suggested by naddy

diff --git a/got/got.c b/got/got.c
index dfa05ac..e0a4032 100644
--- a/got/got.c
+++ b/got/got.c
@@ -3853,7 +3853,7 @@ cmd_log(int argc, char *argv[])
 		}
 	} else
 		error = got_repo_map_path(&in_repo_path, repo,
-		    path ? path : "", 1);
+		    path ? path : "");
 	if (error != NULL)
 		goto done;
 	if (in_repo_path) {
@@ -4526,7 +4526,7 @@ cmd_blame(int argc, char *argv[])
 		error = apply_unveil(got_repo_get_path(repo), 1, NULL);
 		if (error)
 			goto done;
-		error = got_repo_map_path(&in_repo_path, repo, path, 1);
+		error = got_repo_map_path(&in_repo_path, repo, path);
 	}
 	if (error)
 		goto done;
@@ -4859,7 +4859,7 @@ cmd_tree(int argc, char *argv[])
 			goto done;
 		if (path == NULL)
 			path = "/";
-		error = got_repo_map_path(&in_repo_path, repo, path, 1);
+		error = got_repo_map_path(&in_repo_path, repo, path);
 		if (error != NULL)
 			goto done;
 	}
diff --git a/include/got_repository.h b/include/got_repository.h
index 20f873a..9e816e2 100644
--- a/include/got_repository.h
+++ b/include/got_repository.h
@@ -105,7 +105,7 @@ int got_repo_is_bare(struct got_repository *);
 
 /* Attempt to map an arbitrary path to a path within the repository. */
 const struct got_error *got_repo_map_path(char **, struct got_repository *,
-    const char *, int);
+    const char *);
 
 /* Create a new repository in an empty directory at a specified path. */
 const struct got_error *got_repo_init(const char *);
diff --git a/lib/repository.c b/lib/repository.c
index 6d8ef4d..dfc1bf5 100644
--- a/lib/repository.c
+++ b/lib/repository.c
@@ -762,7 +762,7 @@ got_repo_free_remote_repo_data(struct got_remote_repo *repo)
 
 const struct got_error *
 got_repo_map_path(char **in_repo_path, struct got_repository *repo,
-    const char *input_path, int check_disk)
+    const char *input_path)
 {
 	const struct got_error *err = NULL;
 	const char *repo_abspath = NULL;
@@ -782,7 +782,7 @@ got_repo_map_path(char **in_repo_path, struct got_repository *repo,
 
 	repo_abspath = got_repo_get_path(repo);
 
-	if (!check_disk || canonpath[0] == '\0') {
+	if (canonpath[0] == '\0') {
 		path = strdup(canonpath);
 		if (path == NULL) {
 			err = got_error_from_errno("strdup");
diff --git a/tog/tog.c b/tog/tog.c
index 071cab5..ed5c1bc 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -2614,7 +2614,7 @@ get_in_repo_path_from_argv0(char **in_repo_path, int argc, char *argv[],
 		}
 		free(p);
 	} else
-		err = got_repo_map_path(in_repo_path, repo, argv[0], 1);
+		err = got_repo_map_path(in_repo_path, repo, argv[0]);
 
 	return err;
 }