mirror of
https://git.proxmox.com/git/libgit2
synced 2025-07-04 00:34:08 +00:00
Fixed naming convention related issue.
This commit is contained in:
parent
eb2f3b4790
commit
2e6fd09c5d
@ -391,7 +391,7 @@ static int retrieve_previous_path_component_start(const char *path)
|
|||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
int git_prettify_dir_path(char *buffer_out, const char *path)
|
int gitfo_prettify_dir_path(char *buffer_out, const char *path)
|
||||||
{
|
{
|
||||||
int len = 0, segment_len, only_dots;
|
int len = 0, segment_len, only_dots;
|
||||||
char *current;
|
char *current;
|
||||||
@ -457,7 +457,7 @@ int git_prettify_dir_path(char *buffer_out, const char *path)
|
|||||||
return GIT_SUCCESS;
|
return GIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int git_prettify_file_path(char *buffer_out, const char *path)
|
int gitfo_prettify_file_path(char *buffer_out, const char *path)
|
||||||
{
|
{
|
||||||
int error, path_len, i;
|
int error, path_len, i;
|
||||||
const char* pattern = "/..";
|
const char* pattern = "/..";
|
||||||
@ -470,7 +470,7 @@ int git_prettify_file_path(char *buffer_out, const char *path)
|
|||||||
return GIT_ERROR;
|
return GIT_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
error = git_prettify_dir_path(buffer_out, path);
|
error = gitfo_prettify_dir_path(buffer_out, path);
|
||||||
if (error < GIT_SUCCESS)
|
if (error < GIT_SUCCESS)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ extern int gitfo_close_cached(gitfo_cache *ioc);
|
|||||||
* - GIT_SUCCESS on success;
|
* - GIT_SUCCESS on success;
|
||||||
* - GIT_ERROR when the input path is invalid or escapes the current directory.
|
* - GIT_ERROR when the input path is invalid or escapes the current directory.
|
||||||
*/
|
*/
|
||||||
GIT_EXTERN(int) git_prettify_dir_path(char *buffer_out, const char *path);
|
GIT_EXTERN(int) gitfo_prettify_dir_path(char *buffer_out, const char *path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up a provided absolute or relative file path.
|
* Clean up a provided absolute or relative file path.
|
||||||
@ -175,6 +175,6 @@ GIT_EXTERN(int) git_prettify_dir_path(char *buffer_out, const char *path);
|
|||||||
* - GIT_SUCCESS on success;
|
* - GIT_SUCCESS on success;
|
||||||
* - GIT_ERROR when the input path is invalid or escapes the current directory.
|
* - GIT_ERROR when the input path is invalid or escapes the current directory.
|
||||||
*/
|
*/
|
||||||
GIT_EXTERN(int) git_prettify_file_path(char *buffer_out, const char *path);
|
GIT_EXTERN(int) gitfo_prettify_file_path(char *buffer_out, const char *path);
|
||||||
|
|
||||||
#endif /* INCLUDE_fileops_h__ */
|
#endif /* INCLUDE_fileops_h__ */
|
||||||
|
@ -102,7 +102,7 @@ static int assign_repository_DIRs(git_repository *repo,
|
|||||||
if (git_dir == NULL)
|
if (git_dir == NULL)
|
||||||
return GIT_ENOTFOUND;
|
return GIT_ENOTFOUND;
|
||||||
|
|
||||||
error = git_prettify_dir_path(path_aux, git_dir);
|
error = gitfo_prettify_dir_path(path_aux, git_dir);
|
||||||
if (error < GIT_SUCCESS)
|
if (error < GIT_SUCCESS)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ static int assign_repository_DIRs(git_repository *repo,
|
|||||||
if (git_object_directory == NULL)
|
if (git_object_directory == NULL)
|
||||||
strcpy(repo->path_repository + git_dir_path_len, GIT_OBJECTS_DIR);
|
strcpy(repo->path_repository + git_dir_path_len, GIT_OBJECTS_DIR);
|
||||||
else {
|
else {
|
||||||
error = git_prettify_dir_path(path_aux, git_object_directory);
|
error = gitfo_prettify_dir_path(path_aux, git_object_directory);
|
||||||
if (error < GIT_SUCCESS)
|
if (error < GIT_SUCCESS)
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
@ -133,7 +133,7 @@ static int assign_repository_DIRs(git_repository *repo,
|
|||||||
if (git_index_file == NULL)
|
if (git_index_file == NULL)
|
||||||
strcpy(repo->path_repository + git_dir_path_len, GIT_INDEX_FILE);
|
strcpy(repo->path_repository + git_dir_path_len, GIT_INDEX_FILE);
|
||||||
else {
|
else {
|
||||||
error = git_prettify_file_path(path_aux, git_index_file);
|
error = gitfo_prettify_file_path(path_aux, git_index_file);
|
||||||
if (error < GIT_SUCCESS)
|
if (error < GIT_SUCCESS)
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
@ -148,7 +148,7 @@ static int assign_repository_DIRs(git_repository *repo,
|
|||||||
if (git_work_tree == NULL)
|
if (git_work_tree == NULL)
|
||||||
repo->is_bare = 1;
|
repo->is_bare = 1;
|
||||||
else {
|
else {
|
||||||
error = git_prettify_dir_path(path_aux, git_work_tree);
|
error = gitfo_prettify_dir_path(path_aux, git_work_tree);
|
||||||
if (error < GIT_SUCCESS)
|
if (error < GIT_SUCCESS)
|
||||||
return error;
|
return error;
|
||||||
repo->path_workdir = git__strdup(path_aux);
|
repo->path_workdir = git__strdup(path_aux);
|
||||||
@ -163,7 +163,7 @@ static int guess_repository_DIRs(git_repository *repo, const char *repository_pa
|
|||||||
int path_len;
|
int path_len;
|
||||||
int error = GIT_SUCCESS;
|
int error = GIT_SUCCESS;
|
||||||
|
|
||||||
error = git_prettify_dir_path(path_aux, repository_path);
|
error = gitfo_prettify_dir_path(path_aux, repository_path);
|
||||||
if (error < GIT_SUCCESS)
|
if (error < GIT_SUCCESS)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
@ -585,7 +585,7 @@ static int repo_init_find_dir(repo_init *results, const char* path)
|
|||||||
int path_len;
|
int path_len;
|
||||||
int error = GIT_SUCCESS;
|
int error = GIT_SUCCESS;
|
||||||
|
|
||||||
error = git_prettify_dir_path(temp_path, path);
|
error = gitfo_prettify_dir_path(temp_path, path);
|
||||||
if (error < GIT_SUCCESS)
|
if (error < GIT_SUCCESS)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
@ -23,12 +23,12 @@ static int ensure_normalized(const char *input_path, const char *expected_path,
|
|||||||
|
|
||||||
static int ensure_dir_path_normalized(const char *input_path, const char *expected_path)
|
static int ensure_dir_path_normalized(const char *input_path, const char *expected_path)
|
||||||
{
|
{
|
||||||
return ensure_normalized(input_path, expected_path, git_prettify_dir_path);
|
return ensure_normalized(input_path, expected_path, gitfo_prettify_dir_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ensure_file_path_normalized(const char *input_path, const char *expected_path)
|
static int ensure_file_path_normalized(const char *input_path, const char *expected_path)
|
||||||
{
|
{
|
||||||
return ensure_normalized(input_path, expected_path, git_prettify_file_path);
|
return ensure_normalized(input_path, expected_path, gitfo_prettify_file_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
BEGIN_TEST(file_path_prettifying)
|
BEGIN_TEST(file_path_prettifying)
|
||||||
|
Loading…
Reference in New Issue
Block a user