fs_path: remove now-unused validation functions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
diff --git a/src/fs_path.c b/src/fs_path.c
index 5698014..957f389 100644
--- a/src/fs_path.c
+++ b/src/fs_path.c
@@ -1738,52 +1738,6 @@ int git_fs_path_validate_str_length_with_suffix(
return 0;
}
-#ifdef GIT_WIN32
-GIT_INLINE(bool) should_validate_longpaths(git_repository *repo)
-{
- int longpaths = 0;
-
- if (repo &&
- git_repository__configmap_lookup(&longpaths, repo, GIT_CONFIGMAP_LONGPATHS) < 0)
- longpaths = 0;
-
- return (longpaths == 0);
-}
-
-#else
-
-GIT_INLINE(bool) should_validate_longpaths(git_repository *repo)
-{
- GIT_UNUSED(repo);
-
- return false;
-}
-#endif
-
-int git_fs_path_validate_workdir(git_repository *repo, const char *path)
-{
- if (should_validate_longpaths(repo))
- return git_fs_path_validate_filesystem(path, strlen(path));
-
- return 0;
-}
-
-int git_fs_path_validate_workdir_with_len(
- git_repository *repo,
- const char *path,
- size_t path_len)
-{
- if (should_validate_longpaths(repo))
- return git_fs_path_validate_filesystem(path, path_len);
-
- return 0;
-}
-
-int git_fs_path_validate_workdir_buf(git_repository *repo, git_str *path)
-{
- return git_fs_path_validate_workdir_with_len(repo, path->ptr, path->size);
-}
-
int git_fs_path_normalize_slashes(git_str *out, const char *path)
{
int error;
diff --git a/src/fs_path.h b/src/fs_path.h
index 116e8f9..dcedd5e 100644
--- a/src/fs_path.h
+++ b/src/fs_path.h
@@ -726,28 +726,6 @@ GIT_INLINE(int) git_fs_path_validate_filesystem(
}
/**
- * Validate a path relative to the repo's worktree. This ensures that
- * the given working tree path is valid for the operating system/platform.
- * This will ensure that an absolute path is smaller than MAX_PATH on
- * Windows, while keeping `core.longpaths` configuration settings in mind.
- *
- * This should be checked by mechamisms like `git_checkout` after
- * contructing on-disk paths and before trying to write them.
- *
- * If the repository is null, no repository configuration is applied.
- */
-extern int git_fs_path_validate_workdir(
- git_repository *repo,
- const char *path);
-extern int git_fs_path_validate_workdir_with_len(
- git_repository *repo,
- const char *path,
- size_t path_len);
-extern int git_fs_path_validate_workdir_buf(
- git_repository *repo,
- git_str *buf);
-
-/**
* Convert any backslashes into slashes
*/
int git_fs_path_normalize_slashes(git_str *out, const char *path);