Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
0e198408
Commit
0e198408
authored
Oct 22, 2012
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1008 from nulltoken/fix/chunked_blob
blob: do not create temp files in the current path
parents
c497a63b
cfa6465c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
+10
-1
src/blob.c
+10
-1
No files found.
src/blob.c
View file @
0e198408
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment