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
0132cf64
Commit
0132cf64
authored
Jun 25, 2011
by
Carlos Martín Nieto
Committed by
Vicent Marti
Aug 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git_pkt_send_wants
parent
e1f4a761
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
src/pkt.c
+26
-0
No files found.
src/pkt.c
View file @
0132cf64
...
...
@@ -209,3 +209,29 @@ int git_pkt_send_flush(int s)
return
gitno_send
(
s
,
flush
,
STRLEN
(
flush
),
0
);
}
/*
* All "want" packets have the same length and format, so what we do
* is overwrite the OID each time.
*/
#define WANT_PREFIX "0032want "
int
git_pkt_send_wants
(
git_headarray
*
refs
)
{
unsigned
int
i
;
int
ret
=
GIT_SUCCESS
;
char
buf
[
STRLEN
(
WANT_PREFIX
)
+
GIT_OID_HEXSZ
+
2
];
git_remote_head
*
head
;
memcpy
(
buf
,
WANT_PREFIX
,
STRLEN
(
WANT_PREFIX
));
buf
[
sizeof
(
buf
)
-
2
]
=
'\n'
;
buf
[
sizeof
(
buf
)
-
1
]
=
'\0'
;
for
(
i
=
0
;
i
<
refs
->
len
;
++
i
)
{
head
=
refs
->
heads
[
i
];
git_oid_fmt
(
buf
+
STRLEN
(
WANT_PREFIX
),
&
head
->
oid
);
printf
(
"would send %s
\n
"
,
buf
);
}
return
ret
;
}
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