diff options
author | Russell Belfer <arrbee@arrbee.com> | 2012-01-17 15:49:47 -0800 |
---|---|---|
committer | Russell Belfer <arrbee@arrbee.com> | 2012-01-17 15:49:47 -0800 |
commit | 1744fafec05d8fa3036a43f5e390c790810b05a5 (patch) | |
tree | b87f0616dd832ec66cc2450b5751b70d468a350e /src/odb_loose.c | |
parent | d1317f1b69cafb328ca9b263b2b71cddeb2290be (diff) | |
download | libgit2-1744fafec05d8fa3036a43f5e390c790810b05a5.tar.gz |
Move path related functions from fileops to path
This takes all of the functions that look up simple data about
paths (such as `git_futils_isdir`) and moves them over to path.h
(becoming `git_path_isdir`). This leaves fileops.h just with
functions that actually manipulate the filesystem or look at
the file contents in some way.
As part of this, the dir.h header which is really just for win32
support was moved into win32 (with some minor changes).
Diffstat (limited to 'src/odb_loose.c')
-rw-r--r-- | src/odb_loose.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/odb_loose.c b/src/odb_loose.c index f177af86c..d958fce9f 100644 --- a/src/odb_loose.c +++ b/src/odb_loose.c @@ -466,7 +466,7 @@ static int locate_object( int error = object_file_name(object_location, backend->objects_dir, oid); if (error == GIT_SUCCESS) - error = git_futils_exists(git_buf_cstr(object_location)); + error = git_path_exists(git_buf_cstr(object_location)); return error; } @@ -480,7 +480,7 @@ static int fn_locate_object_short_oid(void *state, git_buf *pathbuf) { return GIT_SUCCESS; } - if (!git_futils_exists(pathbuf->ptr) && git_futils_isdir(pathbuf->ptr)) { + if (!git_path_exists(pathbuf->ptr) && git_path_isdir(pathbuf->ptr)) { /* We are already in the directory matching the 2 first hex characters, * compare the first ncmp characters of the oids */ if (!memcmp(sstate->short_oid + 2, @@ -533,8 +533,8 @@ static int locate_object_short_oid( return git__rethrow(error, "Failed to locate object from short oid"); /* Check that directory exists */ - if (git_futils_exists(object_location->ptr) || - git_futils_isdir(object_location->ptr)) + if (git_path_exists(object_location->ptr) || + git_path_isdir(object_location->ptr)) return git__throw(GIT_ENOTFOUND, "Failed to locate object from short oid. Object not found"); state.dir_len = object_location->size; @@ -542,7 +542,7 @@ static int locate_object_short_oid( state.found = 0; /* Explore directory to find a unique object matching short_oid */ - error = git_futils_direach(object_location, fn_locate_object_short_oid, &state); + error = git_path_direach(object_location, fn_locate_object_short_oid, &state); if (error) return git__rethrow(error, "Failed to locate object from short oid"); @@ -716,7 +716,7 @@ static int loose_backend__stream_fwrite(git_oid *oid, git_odb_stream *_stream) * is what git does and allows us to sidestep the fact that * we're not allowed to overwrite a read-only file on Windows. */ - if (git_futils_exists(final_path.ptr) == GIT_SUCCESS) { + if (git_path_exists(final_path.ptr) == GIT_SUCCESS) { git_filebuf_cleanup(&stream->fbuf); goto cleanup; } |