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
4dfe3820
Commit
4dfe3820
authored
Sep 09, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Comment updates
parent
5fb1f9f2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
include/git2/odb.h
+4
-3
include/git2/odb_backend.h
+9
-9
No files found.
include/git2/odb.h
View file @
4dfe3820
...
@@ -223,7 +223,8 @@ GIT_EXTERN(int) git_odb_write(git_oid *out, git_odb *odb, const void *data, size
...
@@ -223,7 +223,8 @@ GIT_EXTERN(int) git_odb_write(git_oid *out, git_odb *odb, const void *data, size
* won't be effective until `git_odb_stream_finalize_write` is called
* won't be effective until `git_odb_stream_finalize_write` is called
* and returns without an error
* and returns without an error
*
*
* The stream must always be free'd or will leak memory.
* The stream must always be freed when done with `git_odb_stream_free` or
* will leak memory.
*
*
* @see git_odb_stream
* @see git_odb_stream
*
*
...
@@ -238,8 +239,8 @@ GIT_EXTERN(int) git_odb_open_wstream(git_odb_stream **out, git_odb *db, size_t s
...
@@ -238,8 +239,8 @@ GIT_EXTERN(int) git_odb_open_wstream(git_odb_stream **out, git_odb *db, size_t s
/**
/**
* Write to an odb stream
* Write to an odb stream
*
*
* This method will fail
as soon as the total number of
* This method will fail
if the total number of received bytes exceeds the
*
received bytes exceeds the
size declared with `git_odb_open_wstream()`
* size declared with `git_odb_open_wstream()`
*
*
* @param stream the stream
* @param stream the stream
* @param buffer the data to write
* @param buffer the data to write
...
...
include/git2/odb_backend.h
View file @
4dfe3820
...
@@ -82,8 +82,7 @@ struct git_odb_stream {
...
@@ -82,8 +82,7 @@ struct git_odb_stream {
size_t
received_bytes
;
size_t
received_bytes
;
/**
/**
* Write at most `len` bytes into `buffer` and advance the
* Write at most `len` bytes into `buffer` and advance the stream.
* stream.
*/
*/
int
(
*
read
)(
git_odb_stream
*
stream
,
char
*
buffer
,
size_t
len
);
int
(
*
read
)(
git_odb_stream
*
stream
,
char
*
buffer
,
size_t
len
);
...
@@ -96,18 +95,19 @@ struct git_odb_stream {
...
@@ -96,18 +95,19 @@ struct git_odb_stream {
* Store the contents of the stream as an object with the id
* Store the contents of the stream as an object with the id
* specified in `oid`.
* specified in `oid`.
*
*
* This method will *not* be invoked by libgit2 when:
* This method might not be invoked if:
* - the object pointed at by `oid` already exists in any backend.
* - an error occurs earlier with the `write` callback,
* - the total number of received bytes differs from the size declared
* - the object referred to by `oid` already exists in any backend, or
* with `git_odb_open_wstream()`
* - the final number of received bytes differs from the size declared
*
* with `git_odb_open_wstream()`
* Libgit2 will however take care of properly disposing the stream through
* a call to `free()`.
*/
*/
int
(
*
finalize_write
)(
git_odb_stream
*
stream
,
const
git_oid
*
oid
);
int
(
*
finalize_write
)(
git_odb_stream
*
stream
,
const
git_oid
*
oid
);
/**
/**
* Free the stream's memory.
* Free the stream's memory.
*
* This method might be called without a call to `finalize_write` if
* an error occurs or if the object is already present in the ODB.
*/
*/
void
(
*
free
)(
git_odb_stream
*
stream
);
void
(
*
free
)(
git_odb_stream
*
stream
);
};
};
...
...
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