summaryrefslogtreecommitdiff
path: root/src/odb.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-07-04 11:43:34 +0200
committerVicent Marti <tanoku@gmail.com>2011-07-05 02:04:03 +0200
commitf79026b4912bcd2336667f4c1663c06e233f0b32 (patch)
tree645b776032e924b587fad986aa3f3dc08c98d4c5 /src/odb.c
parent678e9e045becdc5d75f2ce2259ed01c3531ee181 (diff)
downloadlibgit2-f79026b4912bcd2336667f4c1663c06e233f0b32.tar.gz
fileops: Cleanup
Cleaned up the structure of the whole OS-abstraction layer. fileops.c now contains a set of utility methods for file management used by the library. These are abstractions on top of the original POSIX calls. There's a new file called `posix.c` that contains emulations/reimplementations of all the POSIX calls the library uses. These are prefixed with `p_`. There's a specific posix file for each platform (win32 and unix). All the path-related methods have been moved from `utils.c` to `path.c` and have their own prefix.
Diffstat (limited to 'src/odb.c')
-rw-r--r--src/odb.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/odb.c b/src/odb.c
index 0ee790e14..b09931660 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -323,15 +323,15 @@ static int load_alternates(git_odb *odb, const char *objects_dir)
char alternates_path[GIT_PATH_MAX];
char *buffer, *alternate;
- gitfo_buf alternates_buf = GITFO_BUF_INIT;
+ git_fbuffer alternates_buf = GIT_FBUFFER_INIT;
int error;
- git__joinpath(alternates_path, objects_dir, GIT_ALTERNATES_FILE);
+ git_path_join(alternates_path, objects_dir, GIT_ALTERNATES_FILE);
- if (gitfo_exists(alternates_path) < GIT_SUCCESS)
+ if (git_futils_exists(alternates_path) < GIT_SUCCESS)
return GIT_SUCCESS;
- if (gitfo_read_file(&alternates_buf, alternates_path) < GIT_SUCCESS)
+ if (git_futils_readbuffer(&alternates_buf, alternates_path) < GIT_SUCCESS)
return git__throw(GIT_EOSERR, "Failed to add backend. Can't read alternates");
buffer = (char *)alternates_buf.data;
@@ -346,7 +346,7 @@ static int load_alternates(git_odb *odb, const char *objects_dir)
/* relative path: build based on the current `objects` folder */
if (*alternate == '.') {
- git__joinpath(full_path, objects_dir, alternate);
+ git_path_join(full_path, objects_dir, alternate);
alternate = full_path;
}
@@ -354,7 +354,7 @@ static int load_alternates(git_odb *odb, const char *objects_dir)
break;
}
- gitfo_free_buf(&alternates_buf);
+ git_futils_freebuffer(&alternates_buf);
if (error < GIT_SUCCESS)
return git__rethrow(error, "Failed to load alternates");
return error;