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
7baa7631
Commit
7baa7631
authored
Oct 02, 2013
by
Jameson Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Style tweaks and changes for code review feedback
parent
83db7e09
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
src/transports/smart_protocol.c
+6
-8
tests-clar/online/push.c
+2
-0
No files found.
src/transports/smart_protocol.c
View file @
7baa7631
...
@@ -436,7 +436,7 @@ static int network_packetsize(size_t received, void *payload)
...
@@ -436,7 +436,7 @@ static int network_packetsize(size_t received, void *payload)
if
((
npp
->
stats
->
received_bytes
-
npp
->
last_fired_bytes
)
>
NETWORK_XFER_THRESHOLD
)
{
if
((
npp
->
stats
->
received_bytes
-
npp
->
last_fired_bytes
)
>
NETWORK_XFER_THRESHOLD
)
{
npp
->
last_fired_bytes
=
npp
->
stats
->
received_bytes
;
npp
->
last_fired_bytes
=
npp
->
stats
->
received_bytes
;
if
(
npp
->
callback
(
npp
->
stats
,
npp
->
payload
))
if
(
npp
->
callback
(
npp
->
stats
,
npp
->
payload
))
return
GIT_EUSER
;
return
GIT_EUSER
;
}
}
...
@@ -468,7 +468,7 @@ int git_smart__download_pack(
...
@@ -468,7 +468,7 @@ int git_smart__download_pack(
/* We might have something in the buffer already from negotiate_fetch */
/* We might have something in the buffer already from negotiate_fetch */
if
(
t
->
buffer
.
offset
>
0
&&
!
t
->
cancelled
.
val
)
if
(
t
->
buffer
.
offset
>
0
&&
!
t
->
cancelled
.
val
)
if
(
t
->
packetsize_cb
(
t
->
buffer
.
offset
,
t
->
packetsize_payload
))
if
(
t
->
packetsize_cb
(
t
->
buffer
.
offset
,
t
->
packetsize_payload
))
git_atomic_set
(
&
t
->
cancelled
,
1
);
git_atomic_set
(
&
t
->
cancelled
,
1
);
}
}
...
@@ -526,8 +526,7 @@ int git_smart__download_pack(
...
@@ -526,8 +526,7 @@ int git_smart__download_pack(
}
}
}
while
(
1
);
}
while
(
1
);
if
((
error
=
writepack
->
commit
(
writepack
,
stats
))
<
0
)
error
=
writepack
->
commit
(
writepack
,
stats
);
goto
done
;
done:
done:
if
(
writepack
)
if
(
writepack
)
...
@@ -836,7 +835,7 @@ static int stream_thunk(void *buf, size_t size, void *data)
...
@@ -836,7 +835,7 @@ static int stream_thunk(void *buf, size_t size, void *data)
if
((
current_time
-
payload
->
last_progress_report_time
)
>=
MIN_PROGRESS_UPDATE_INTERVAL
)
{
if
((
current_time
-
payload
->
last_progress_report_time
)
>=
MIN_PROGRESS_UPDATE_INTERVAL
)
{
payload
->
last_progress_report_time
=
current_time
;
payload
->
last_progress_report_time
=
current_time
;
if
(
payload
->
cb
(
payload
->
pb
->
nr_written
,
payload
->
pb
->
nr_objects
,
payload
->
last_bytes
,
payload
->
cb_payload
))
{
if
(
payload
->
cb
(
payload
->
pb
->
nr_written
,
payload
->
pb
->
nr_objects
,
payload
->
last_bytes
,
payload
->
cb_payload
))
{
giterr_clear
();
giterr_clear
();
error
=
GIT_EUSER
;
error
=
GIT_EUSER
;
}
}
...
@@ -914,9 +913,8 @@ int git_smart__push(git_transport *transport, git_push *push)
...
@@ -914,9 +913,8 @@ int git_smart__push(git_transport *transport, git_push *push)
push
->
transfer_progress_cb
(
push
->
pb
->
nr_written
,
push
->
pb
->
nr_objects
,
packbuilder_payload
.
last_bytes
,
push
->
transfer_progress_cb_payload
);
push
->
transfer_progress_cb
(
push
->
pb
->
nr_written
,
push
->
pb
->
nr_objects
,
packbuilder_payload
.
last_bytes
,
push
->
transfer_progress_cb_payload
);
}
}
if
(
push
->
status
.
length
&&
if
(
push
->
status
.
length
)
(
error
=
update_refs_from_report
(
&
t
->
refs
,
&
push
->
specs
,
&
push
->
status
))
<
0
)
error
=
update_refs_from_report
(
&
t
->
refs
,
&
push
->
specs
,
&
push
->
status
);
goto
done
;
done:
done:
git_buf_free
(
&
pktline
);
git_buf_free
(
&
pktline
);
...
...
tests-clar/online/push.c
View file @
7baa7631
...
@@ -348,6 +348,7 @@ void test_online_push__cleanup(void)
...
@@ -348,6 +348,7 @@ void test_online_push__cleanup(void)
static
int
push_pack_progress_cb
(
int
stage
,
unsigned
int
current
,
unsigned
int
total
,
void
*
payload
)
static
int
push_pack_progress_cb
(
int
stage
,
unsigned
int
current
,
unsigned
int
total
,
void
*
payload
)
{
{
int
*
was_called
=
(
int
*
)
payload
;
int
*
was_called
=
(
int
*
)
payload
;
GIT_UNUSED
(
stage
);
GIT_UNUSED
(
current
);
GIT_UNUSED
(
total
);
*
was_called
=
1
;
*
was_called
=
1
;
return
0
;
return
0
;
}
}
...
@@ -355,6 +356,7 @@ static int push_pack_progress_cb(int stage, unsigned int current, unsigned int t
...
@@ -355,6 +356,7 @@ static int push_pack_progress_cb(int stage, unsigned int current, unsigned int t
static
int
push_transfer_progress_cb
(
unsigned
int
current
,
unsigned
int
total
,
size_t
bytes
,
void
*
payload
)
static
int
push_transfer_progress_cb
(
unsigned
int
current
,
unsigned
int
total
,
size_t
bytes
,
void
*
payload
)
{
{
int
*
was_called
=
(
int
*
)
payload
;
int
*
was_called
=
(
int
*
)
payload
;
GIT_UNUSED
(
current
);
GIT_UNUSED
(
total
);
GIT_UNUSED
(
bytes
);
*
was_called
=
1
;
*
was_called
=
1
;
return
0
;
return
0
;
}
}
...
...
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