Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
1217c5b2
Commit
1217c5b2
authored
Nov 01, 2021
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs_path: remove now-unused validation functions
parent
62251409
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
68 deletions
+0
-68
src/fs_path.c
+0
-46
src/fs_path.h
+0
-22
No files found.
src/fs_path.c
View file @
1217c5b2
...
...
@@ -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
;
...
...
src/fs_path.h
View file @
1217c5b2
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment