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
cbcaf0c0
Commit
cbcaf0c0
authored
May 11, 2011
by
schu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move blob.c to the new error handling
Signed-off-by: schu <schu-github@schulog.org>
parent
40774549
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/blob.c
+3
-3
No files found.
src/blob.c
View file @
cbcaf0c0
...
@@ -62,7 +62,7 @@ int git_blob_create_frombuffer(git_oid *oid, git_repository *repo, const void *b
...
@@ -62,7 +62,7 @@ int git_blob_create_frombuffer(git_oid *oid, git_repository *repo, const void *b
git_odb_stream
*
stream
;
git_odb_stream
*
stream
;
if
((
error
=
git_odb_open_wstream
(
&
stream
,
repo
->
db
,
len
,
GIT_OBJ_BLOB
))
<
GIT_SUCCESS
)
if
((
error
=
git_odb_open_wstream
(
&
stream
,
repo
->
db
,
len
,
GIT_OBJ_BLOB
))
<
GIT_SUCCESS
)
return
error
;
return
git__rethrow
(
error
,
"Failed to create blob. Can't open write stream"
)
;
stream
->
write
(
stream
,
buffer
,
len
);
stream
->
write
(
stream
,
buffer
,
len
);
...
@@ -81,7 +81,7 @@ int git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *pat
...
@@ -81,7 +81,7 @@ int git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *pat
git_odb_stream
*
stream
;
git_odb_stream
*
stream
;
if
(
repo
->
path_workdir
==
NULL
)
if
(
repo
->
path_workdir
==
NULL
)
return
GIT_ENOTFOUND
;
return
git__throw
(
GIT_ENOTFOUND
,
"Failed to create blob. No workdir given"
)
;
git__joinpath
(
full_path
,
repo
->
path_workdir
,
path
);
git__joinpath
(
full_path
,
repo
->
path_workdir
,
path
);
...
@@ -106,7 +106,7 @@ int git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *pat
...
@@ -106,7 +106,7 @@ int git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *pat
if
(
read_len
<
0
)
{
if
(
read_len
<
0
)
{
gitfo_close
(
fd
);
gitfo_close
(
fd
);
stream
->
free
(
stream
);
stream
->
free
(
stream
);
return
GIT_EOSERR
;
return
git__throw
(
GIT_EOSERR
,
"Failed to create blob. Can't read full file"
)
;
}
}
stream
->
write
(
stream
,
buffer
,
read_len
);
stream
->
write
(
stream
,
buffer
,
read_len
);
...
...
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