FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
git2cpp/src/wrapper/patch_wrapper.cpp at main · QuantStack/git2cpp · GitHub
QuantStack
git2cpp
Repository navigation
Code
Issues
6
(6)
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
git2cpp
/
src
/
wrapper
/
patch_wrapper.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
43 lines (38 loc) · 893 Bytes
Breadcrumbs
git2cpp
/
src
/
wrapper
/
patch_wrapper.cpp
Copy path
File metadata and controls
43 lines (38 loc) · 893 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#
include
"
../wrapper/patch_wrapper.hpp
"
#
include
"
../utils/git_exception.hpp
"
patch_wrapper::patch_wrapper
(git_patch* patch)
: base_type(patch)
{
}
patch_wrapper::~patch_wrapper
()
{
git_patch_free
(p_resource);
p_resource =
nullptr
;
}
git_buf
patch_wrapper::to_buf
()
{
git_buf buf =
GIT_BUF_INIT
;
throw_if_error
(
git_patch_to_buf
(&buf, *
this
));
return
buf;
}
patch_wrapper
patch_wrapper::patch_from_files
(
const
std::string& path1,
const
std::string& file1_str,
const
std::string& path2,
const
std::string& file2_str,
git_diff_options* diffopts
)
{
git_patch* patch;
throw_if_error
(
git_patch_from_buffers
(
&patch,
file1_str.
c_str
(),
file1_str.
length
(),
path1.
c_str
(),
file2_str.
c_str
(),
file2_str.
length
(),
path2.
c_str
(),
diffopts
));
return
patch_wrapper
(patch);
}
Back
|
FazBrowse Home
|
New Git URL