2727#include "diff_generate.h"
2828#include "pathspec.h"
2929#include "diff_xdiff.h"
30- #include "path .h"
30+ #include "fs_path .h"
3131#include "attr.h"
3232#include "pool.h"
3333#include "strmap.h"
34+ #include "path.h"
3435
3536/* See docs/checkout-internals.md for more information */
3637
@@ -328,7 +329,7 @@ static int checkout_target_fullpath(
328329 if (path && git_str_puts (& data -> target_path , path ) < 0 )
329330 return -1 ;
330331
331- if (git_path_validate_workdir_buf (data -> repo , & data -> target_path ) < 0 )
332+ if (git_path_validate_str_length (data -> repo , & data -> target_path ) < 0 )
332333 return -1 ;
333334
334335 * out = & data -> target_path ;
@@ -347,7 +348,7 @@ static bool wd_item_is_removable(
347348 if (checkout_target_fullpath (& full , data , wd -> path ) < 0 )
348349 return false;
349350
350- return !full || !git_path_contains (full , DOT_GIT );
351+ return !full || !git_fs_path_contains (full , DOT_GIT );
351352}
352353
353354static int checkout_queue_remove (checkout_data * data , const char * path )
@@ -481,7 +482,7 @@ static bool checkout_is_empty_dir(checkout_data *data, const char *path)
481482 if (checkout_target_fullpath (& fullpath , data , path ) < 0 )
482483 return false;
483484
484- return git_path_is_empty_dir (fullpath -> ptr );
485+ return git_fs_path_is_empty_dir (fullpath -> ptr );
485486}
486487
487488static int checkout_action_with_wd (
@@ -1201,12 +1202,12 @@ static int checkout_conflicts_mark_directoryfile(
12011202 goto done ;
12021203 }
12031204
1204- prefixed = git_path_equal_or_prefixed (path , entry -> path , NULL );
1205+ prefixed = git_fs_path_equal_or_prefixed (path , entry -> path , NULL );
12051206
1206- if (prefixed == GIT_PATH_EQUAL )
1207+ if (prefixed == GIT_FS_PATH_EQUAL )
12071208 continue ;
12081209
1209- if (prefixed == GIT_PATH_PREFIX )
1210+ if (prefixed == GIT_FS_PATH_PREFIX )
12101211 conflict -> directoryfile = 1 ;
12111212
12121213 break ;
@@ -1280,14 +1281,14 @@ static int checkout_verify_paths(
12801281 unsigned int flags = GIT_PATH_REJECT_WORKDIR_DEFAULTS ;
12811282
12821283 if (action & CHECKOUT_ACTION__REMOVE ) {
1283- if (!git_path_validate (repo , delta -> old_file .path , delta -> old_file .mode , flags )) {
1284+ if (!git_path_is_valid (repo , delta -> old_file .path , delta -> old_file .mode , flags )) {
12841285 git_error_set (GIT_ERROR_CHECKOUT , "cannot remove invalid path '%s'" , delta -> old_file .path );
12851286 return -1 ;
12861287 }
12871288 }
12881289
12891290 if (action & ~CHECKOUT_ACTION__REMOVE ) {
1290- if (!git_path_validate (repo , delta -> new_file .path , delta -> new_file .mode , flags )) {
1291+ if (!git_path_is_valid (repo , delta -> new_file .path , delta -> new_file .mode , flags )) {
12911292 git_error_set (GIT_ERROR_CHECKOUT , "cannot checkout to invalid path '%s'" , delta -> new_file .path );
12921293 return -1 ;
12931294 }
@@ -1949,7 +1950,7 @@ static int checkout_path_suffixed(git_str *path, const char *suffix)
19491950
19501951 path_len = git_str_len (path );
19511952
1952- while (git_path_exists (git_str_cstr (path )) && i < INT_MAX ) {
1953+ while (git_fs_path_exists (git_str_cstr (path )) && i < INT_MAX ) {
19531954 git_str_truncate (path , path_len );
19541955
19551956 if ((error = git_str_putc (path , '_' )) < 0 ||
@@ -2034,7 +2035,7 @@ static int checkout_merge_path(
20342035 int error = 0 ;
20352036
20362037 if ((error = git_str_joinpath (out , data -> opts .target_directory , result -> path )) < 0 ||
2037- (error = git_path_validate_workdir_buf (data -> repo , out )) < 0 )
2038+ (error = git_path_validate_str_length (data -> repo , out )) < 0 )
20382039 return error ;
20392040
20402041 /* Most conflicts simply use the filename in the index */
@@ -2337,10 +2338,10 @@ static int validate_target_directory(checkout_data *data)
23372338{
23382339 int error ;
23392340
2340- if ((error = git_path_validate_workdir (data -> repo , data -> opts .target_directory )) < 0 )
2341+ if ((error = git_path_validate_length (data -> repo , data -> opts .target_directory )) < 0 )
23412342 return error ;
23422343
2343- if (git_path_isdir (data -> opts .target_directory ))
2344+ if (git_fs_path_isdir (data -> opts .target_directory ))
23442345 return 0 ;
23452346
23462347 error = checkout_mkdir (data , data -> opts .target_directory , NULL ,
@@ -2507,7 +2508,7 @@ static int checkout_data_init(
25072508 (error = git_vector_init (& data -> remove_conflicts , 0 , NULL )) < 0 ||
25082509 (error = git_vector_init (& data -> update_conflicts , 0 , NULL )) < 0 ||
25092510 (error = git_str_puts (& data -> target_path , data -> opts .target_directory )) < 0 ||
2510- (error = git_path_to_dir (& data -> target_path )) < 0 ||
2511+ (error = git_fs_path_to_dir (& data -> target_path )) < 0 ||
25112512 (error = git_strmap_new (& data -> mkdir_map )) < 0 )
25122513 goto cleanup ;
25132514
0 commit comments