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
923c1652
Commit
923c1652
authored
3 years ago
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transport: add capabilities query function
parent
b5237767
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
include/git2/sys/transport.h
+10
-0
src/transports/local.c
+9
-0
src/transports/smart.c
+9
-0
No files found.
include/git2/sys/transport.h
View file @
923c1652
...
...
@@ -47,6 +47,16 @@ struct git_transport {
const
git_remote_connect_options
*
connect_opts
);
/**
* Gets the capabilities for this remote repository.
*
* This function may be called after a successful call to
* `connect()`.
*/
int
GIT_CALLBACK
(
capabilities
)(
unsigned
int
*
capabilities
,
git_transport
*
transport
);
/**
* Get the list of available references in the remote repository.
*
* This function may be called after a successful call to
...
...
This diff is collapsed.
Click to expand it.
src/transports/local.c
View file @
923c1652
...
...
@@ -256,6 +256,14 @@ static int local_set_connect_opts(
return
git_remote_connect_options_normalize
(
&
t
->
connect_opts
,
t
->
owner
->
repo
,
connect_opts
);
}
static
int
local_capabilities
(
unsigned
int
*
capabilities
,
git_transport
*
transport
)
{
GIT_UNUSED
(
transport
);
*
capabilities
=
0
;
return
0
;
}
static
int
local_ls
(
const
git_remote_head
***
out
,
size_t
*
size
,
git_transport
*
transport
)
{
transport_local
*
t
=
(
transport_local
*
)
transport
;
...
...
@@ -721,6 +729,7 @@ int git_transport_local(git_transport **out, git_remote *owner, void *param)
t
->
parent
.
version
=
GIT_TRANSPORT_VERSION
;
t
->
parent
.
connect
=
local_connect
;
t
->
parent
.
set_connect_opts
=
local_set_connect_opts
;
t
->
parent
.
capabilities
=
local_capabilities
;
t
->
parent
.
negotiate_fetch
=
local_negotiate_fetch
;
t
->
parent
.
download_pack
=
local_download_pack
;
t
->
parent
.
push
=
local_push
;
...
...
This diff is collapsed.
Click to expand it.
src/transports/smart.c
View file @
923c1652
...
...
@@ -226,6 +226,14 @@ static int git_smart__set_connect_opts(
return
git_remote_connect_options_normalize
(
&
t
->
connect_opts
,
t
->
owner
->
repo
,
opts
);
}
static
int
git_smart__capabilities
(
unsigned
int
*
capabilities
,
git_transport
*
transport
)
{
GIT_UNUSED
(
transport
);
*
capabilities
=
0
;
return
0
;
}
static
int
git_smart__ls
(
const
git_remote_head
***
out
,
size_t
*
size
,
git_transport
*
transport
)
{
transport_smart
*
t
=
GIT_CONTAINER_OF
(
transport
,
transport_smart
,
parent
);
...
...
@@ -423,6 +431,7 @@ int git_transport_smart(git_transport **out, git_remote *owner, void *param)
t
->
parent
.
version
=
GIT_TRANSPORT_VERSION
;
t
->
parent
.
connect
=
git_smart__connect
;
t
->
parent
.
set_connect_opts
=
git_smart__set_connect_opts
;
t
->
parent
.
capabilities
=
git_smart__capabilities
;
t
->
parent
.
close
=
git_smart__close
;
t
->
parent
.
free
=
git_smart__free
;
t
->
parent
.
negotiate_fetch
=
git_smart__negotiate_fetch
;
...
...
This diff is collapsed.
Click to expand it.
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