summaryrefslogtreecommitdiff
path: root/src/blob.c
diff options
context:
space:
mode:
authorMichael Schubert <schu@schu.io>2012-10-24 15:46:15 +0200
committerMichael Schubert <schu@schu.io>2012-10-24 15:46:15 +0200
commitab2af775ec467ebb328a7374653f247920f258f3 (patch)
treedfcb09fadc67bc28a99bffcb8b751d426024974c /src/blob.c
parent90fefe87d87b08010a1ea10ae496a4b0ee630f5e (diff)
parent6f6b0c013c6eff2aca2a7ada1027044f2e20f578 (diff)
downloadlibgit2-features/push_old.tar.gz
Merge branch 'development' into gsoc-pushfeatures/push_old
Diffstat (limited to 'src/blob.c')
-rw-r--r--src/blob.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/blob.c b/src/blob.c
index 6137746e1..76d265faa 100644
--- a/src/blob.c
+++ b/src/blob.c
@@ -255,11 +255,19 @@ int git_blob_create_fromchunks(
int error = -1, read_bytes;
char *content = NULL;
git_filebuf file = GIT_FILEBUF_INIT;
+ git_buf path = GIT_BUF_INIT;
+
+ if (git_buf_join_n(
+ &path, '/', 3,
+ git_repository_path(repo),
+ GIT_OBJECTS_DIR,
+ "streamed") < 0)
+ goto cleanup;
content = git__malloc(BUFFER_SIZE);
GITERR_CHECK_ALLOC(content);
- if (git_filebuf_open(&file, hintpath == NULL ? "streamed" : hintpath, GIT_FILEBUF_TEMPORARY) < 0)
+ if (git_filebuf_open(&file, git_buf_cstr(&path), GIT_FILEBUF_TEMPORARY) < 0)
goto cleanup;
while (1) {
@@ -283,6 +291,7 @@ int git_blob_create_fromchunks(
error = blob_create_internal(oid, repo, file.path_lock, hintpath, hintpath != NULL);
cleanup:
+ git_buf_free(&path);
git_filebuf_cleanup(&file);
git__free(content);
return error;