Commit 7baa7631 by Jameson Miller

Style tweaks and changes for code review feedback

parent 83db7e09
...@@ -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);
......
...@@ -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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment