FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
git2cpp/src/wrapper/remote_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
/
remote_wrapper.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
62 lines (50 loc) · 1.48 KB
Breadcrumbs
git2cpp
/
src
/
wrapper
/
remote_wrapper.cpp
Copy path
File metadata and controls
62 lines (50 loc) · 1.48 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#
include
"
../wrapper/remote_wrapper.hpp
"
#
include
<
string
>
#
include
<
vector
>
#
include
"
../utils/git_exception.hpp
"
remote_wrapper::remote_wrapper
(git_remote* remote)
: base_type(remote)
{
}
remote_wrapper::~remote_wrapper
()
{
git_remote_free
(p_resource);
p_resource =
nullptr
;
}
std::string_view
remote_wrapper::name
()
const
{
const
char
* out =
git_remote_name
(*
this
);
return
out ?
std::string_view
(out) :
std::string_view
();
}
std::string_view
remote_wrapper::url
()
const
{
const
char
* out =
git_remote_url
(*
this
);
return
out ?
std::string_view
(out) :
std::string_view
();
}
std::string_view
remote_wrapper::pushurl
()
const
{
const
char
* out =
git_remote_pushurl
(*
this
);
return
out ?
std::string_view
(out) :
std::string_view
();
}
std::vector<std::string>
remote_wrapper::refspecs
()
const
{
git_strarray refspecs = {
0
};
std::vector<std::string> result;
if
(
git_remote_get_fetch_refspecs
(&refspecs, *
this
) ==
0
)
{
for
(
size_t
i =
0
; i < refspecs.
count
; ++i)
{
result.
emplace_back
(refspecs.
strings
[i]);
}
git_strarray_dispose
(&refspecs);
}
return
result;
}
void
remote_wrapper::fetch
(
const
git_strarray* refspecs,
const
git_fetch_options* opts,
const
char
* reflog_message)
{
throw_if_error
(
git_remote_fetch
(*
this
, refspecs, opts, reflog_message));
}
void
remote_wrapper::push
(
const
git_strarray* refspecs,
const
git_push_options* opts)
{
throw_if_error
(
git_remote_push
(*
this
, refspecs, opts));
}
Back
|
FazBrowse Home
|
New Git URL