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
0e20ba60
Commit
0e20ba60
authored
Jul 30, 2011
by
Carlos Martín Nieto
Committed by
Vicent Marti
Aug 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a generic send_wants
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
parent
65fbc48a
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
2 deletions
+40
-2
src/fetch.c
+5
-2
src/remote.c
+5
-0
src/remote.h
+2
-0
src/transport.c
+5
-0
src/transport.h
+6
-0
src/transport_git.c
+8
-0
src/transport_local.c
+9
-0
No files found.
src/fetch.c
View file @
0e20ba60
...
...
@@ -44,7 +44,10 @@ static int whn_cmp(const void *a, const void *b)
return
headb
->
type
-
heada
->
type
;
}
/* FIXME: we assume that the transport has been connected, enforce that somehow */
/*
* FIXME: we assume that the transport has been connected, enforce
* that somehow, we also want to be called from _negotiate
*/
int
git_fetch_list_want
(
git_headarray
*
whn_list
,
git_repository
*
repo
,
git_remote
*
remote
)
{
git_vector
list
;
...
...
@@ -179,7 +182,7 @@ int git_fetch_negotiate(git_headarray *list, git_repository *repo, git_remote *r
* Now we have everything set up so we can start tell the server
* what we want and what we have.
*/
git_
pkt_send_wants
(
list
);
git_
remote_send_wants
(
remote
,
list
);
cleanup:
...
...
src/remote.c
View file @
0e20ba60
...
...
@@ -31,6 +31,11 @@
#include "repository.h"
#include "remote.h"
int
git_remote_send_wants
(
git_remote
*
remote
,
git_headarray
*
list
)
{
return
git_transport_send_wants
(
remote
->
transport
,
list
);
}
static
int
refspec_parse
(
git_refspec
*
refspec
,
const
char
*
str
)
{
char
*
delim
;
...
...
src/remote.h
View file @
0e20ba60
...
...
@@ -13,4 +13,6 @@ struct git_remote {
git_transport
*
transport
;
};
int
git_remote_send_wants
(
git_remote
*
remote
,
git_headarray
*
list
);
#endif
src/transport.c
View file @
0e20ba60
...
...
@@ -80,6 +80,11 @@ int git_transport_ls(git_transport *transport, git_headarray *array)
return
transport
->
ls
(
transport
,
array
);
}
int
git_transport_send_wants
(
struct
git_transport
*
transport
,
git_headarray
*
array
)
{
return
transport
->
send_wants
(
transport
,
array
);
}
int
git_transport_close
(
git_transport
*
transport
)
{
return
transport
->
close
(
transport
);
...
...
src/transport.h
View file @
0e20ba60
...
...
@@ -57,6 +57,10 @@ struct git_transport {
*/
int
(
*
push
)(
struct
git_transport
*
transport
);
/**
* Send the list of 'want' refs
*/
int
(
*
send_wants
)(
struct
git_transport
*
transport
,
git_headarray
*
list
);
/**
* Fetch the changes
*/
int
(
*
fetch
)(
struct
git_transport
*
transport
);
...
...
@@ -74,4 +78,6 @@ int git_transport_local(struct git_transport **transport);
int
git_transport_git
(
struct
git_transport
**
transport
);
int
git_transport_dummy
(
struct
git_transport
**
transport
);
int
git_transport_send_wants
(
struct
git_transport
*
transport
,
git_headarray
*
array
);
#endif
src/transport_git.c
View file @
0e20ba60
...
...
@@ -274,6 +274,13 @@ static int git_ls(git_transport *transport, git_headarray *array)
return
GIT_SUCCESS
;
}
static
int
git_send_wants
(
git_transport
*
transport
,
git_headarray
*
array
)
{
transport_git
*
t
=
(
transport_git
*
)
transport
;
return
git_pkt_send_wants
(
array
,
t
->
socket
);
}
static
int
git_close
(
git_transport
*
transport
)
{
transport_git
*
t
=
(
transport_git
*
)
transport
;
...
...
@@ -318,6 +325,7 @@ int git_transport_git(git_transport **out)
t
->
parent
.
connect
=
git_connect
;
t
->
parent
.
ls
=
git_ls
;
t
->
parent
.
send_wants
=
git_send_wants
;
t
->
parent
.
close
=
git_close
;
t
->
parent
.
free
=
git_free
;
...
...
src/transport_local.c
View file @
0e20ba60
...
...
@@ -165,6 +165,15 @@ static int local_ls(git_transport *transport, git_headarray *array)
return
error
;
}
static
int
local_send_wants
(
git_transport
*
GIT_UNUSED
(
transport
),
git_headarray
*
GIT_UNUSED
(
array
))
{
GIT_UNUSED_ARG
(
tranport
);
GIT_UNUSED_ARG
(
array
);
/* We're local anyway, so we don't need this */
return
GIT_SUCCESS
;
}
static
int
local_close
(
git_transport
*
GIT_UNUSED
(
transport
))
{
/* Nothing to do */
...
...
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