Fixed naming convention related issue.
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 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
diff --git a/src/fileops.c b/src/fileops.c
index d23246d..c2668c5 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -391,7 +391,7 @@ static int retrieve_previous_path_component_start(const char *path)
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;
char *current;
@@ -457,7 +457,7 @@ int git_prettify_dir_path(char *buffer_out, const char *path)
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;
const char* pattern = "/..";
@@ -470,7 +470,7 @@ int git_prettify_file_path(char *buffer_out, const char *path)
return GIT_ERROR;
}
- error = git_prettify_dir_path(buffer_out, path);
+ error = gitfo_prettify_dir_path(buffer_out, path);
if (error < GIT_SUCCESS)
return error;
diff --git a/src/fileops.h b/src/fileops.h
index 1f17960..d333805 100644
--- a/src/fileops.h
+++ b/src/fileops.h
@@ -153,7 +153,7 @@ extern int gitfo_close_cached(gitfo_cache *ioc);
* - GIT_SUCCESS on success;
* - 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.
@@ -175,6 +175,6 @@ GIT_EXTERN(int) git_prettify_dir_path(char *buffer_out, const char *path);
* - GIT_SUCCESS on success;
* - 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__ */
diff --git a/src/repository.c b/src/repository.c
index 661b240..349afba 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -102,7 +102,7 @@ static int assign_repository_DIRs(git_repository *repo,
if (git_dir == NULL)
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)
return error;
@@ -118,7 +118,7 @@ static int assign_repository_DIRs(git_repository *repo,
if (git_object_directory == NULL)
strcpy(repo->path_repository + git_dir_path_len, GIT_OBJECTS_DIR);
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)
return error;
}
@@ -133,7 +133,7 @@ static int assign_repository_DIRs(git_repository *repo,
if (git_index_file == NULL)
strcpy(repo->path_repository + git_dir_path_len, GIT_INDEX_FILE);
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)
return error;
}
@@ -148,7 +148,7 @@ static int assign_repository_DIRs(git_repository *repo,
if (git_work_tree == NULL)
repo->is_bare = 1;
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)
return error;
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 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)
return error;
@@ -585,7 +585,7 @@ static int repo_init_find_dir(repo_init *results, const char* path)
int path_len;
int error = GIT_SUCCESS;
- error = git_prettify_dir_path(temp_path, path);
+ error = gitfo_prettify_dir_path(temp_path, path);
if (error < GIT_SUCCESS)
return error;
diff --git a/tests/t0005-path.c b/tests/t0005-path.c
index 087373c..d307fc4 100644
--- a/tests/t0005-path.c
+++ b/tests/t0005-path.c
@@ -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)
{
- 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)
{
- 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)