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
0fd5a44d
Commit
0fd5a44d
authored
Aug 08, 2016
by
Carlos Martín Nieto
Committed by
GitHub
Aug 08, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3888 from libgit2/ethomson/doc_diff_from_buffer
diff: document `git_diff_from_buffer`
parents
56bbdf93
e2e7f31a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
CHANGELOG.md
+3
-0
include/git2/diff.h
+19
-0
No files found.
CHANGELOG.md
View file @
0fd5a44d
...
...
@@ -46,6 +46,9 @@ v0.24 + 1
`git_repository_open_ext` with this flag will error out if either
`$GIT_WORK_TREE` or `$GIT_COMMON_DIR` is set.
*
`git_diff_from_buffer`
can create a
`git_diff`
object from the contents
of a git-style patch file.
### API removals
*
`git_blob_create_fromchunks()`
has been removed in favour of
...
...
include/git2/diff.h
View file @
0fd5a44d
...
...
@@ -1189,6 +1189,25 @@ GIT_EXTERN(int) git_diff_buffers(
git_diff_line_cb
line_cb
,
void
*
payload
);
/**
* Read the contents of a git patch file into a `git_diff` object.
*
* The diff object produced is similar to the one that would be
* produced if you actually produced it computationally by comparing
* two trees, however there may be subtle differences. For example,
* a patch file likely contains abbreviated object IDs, so the
* object IDs in a `git_diff_delta` produced by this function will
* also be abbreviated.
*
* This function will only read patch files created by a git
* implementation, it will not read unified diffs produced by
* the `diff` program, nor any other types of patch files.
*
* @param out A pointer to a git_diff pointer that will be allocated.
* @param content The contents of a patch file
* @param content_len The length of the patch file contents
* @return 0 or an error code
*/
GIT_EXTERN
(
int
)
git_diff_from_buffer
(
git_diff
**
out
,
const
char
*
content
,
...
...
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