Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-09-12 09:00:36 +0400
committerRussell Belfer <rb@github.com>2013-09-17 20:31:45 +0400
commita9f51e430fef49b3299ec33c11a4e6623e3f58cc (patch)
treea3162a8bcf71628f0750d5560923e7783be38eca /src/checkout.c
parent4b11f25a4fbb6952284e037a70e2d61fde841ab6 (diff)
Merge git_buf and git_buffer
This makes the git_buf struct that was used internally into an externally available structure and eliminates the git_buffer. As part of that, some of the special cases that arose with the externally used git_buffer were blended into the git_buf, such as being careful about git_buf objects that may have a NULL ptr and allowing for bufs with a valid ptr and size but zero asize as a way of referring to externally owned data.
Diffstat (limited to 'src/checkout.c')
-rw-r--r--src/checkout.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/checkout.c b/src/checkout.c
index 7e79c9b5e..140544c77 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -678,20 +678,19 @@ fail:
static int buffer_to_file(
struct stat *st,
- git_buffer *buffer,
+ git_buf *buf,
const char *path,
mode_t dir_mode,
int file_open_flags,
mode_t file_mode)
{
int error;
- git_buf buf = GIT_BUF_FROM_BUFFER(buffer);
if ((error = git_futils_mkpath2file(path, dir_mode)) < 0)
return error;
if ((error = git_futils_writebuffer(
- &buf, path, file_open_flags, file_mode)) < 0)
+ buf, path, file_open_flags, file_mode)) < 0)
return error;
if (st != NULL && (error = p_stat(path, st)) < 0)
@@ -713,7 +712,7 @@ static int blob_content_to_file(
{
int error = 0;
mode_t file_mode = opts->file_mode ? opts->file_mode : entry_filemode;
- git_buffer out = GIT_BUFFER_INIT;
+ git_buf out = GIT_BUF_INIT;
git_filter_list *fl = NULL;
if (!opts->disable_filters && !git_blob_is_binary(blob))
@@ -731,7 +730,7 @@ static int blob_content_to_file(
st->st_mode = entry_filemode;
- git_buffer_free(&out);
+ git_buf_free(&out);
}
return error;