Style tweaks and changes for code review feedback
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
diff --git a/src/transports/smart_protocol.c b/src/transports/smart_protocol.c
index 87e807e..2467790 100644
--- a/src/transports/smart_protocol.c
+++ b/src/transports/smart_protocol.c
@@ -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) {
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;
}
@@ -468,7 +468,7 @@ int git_smart__download_pack(
/* We might have something in the buffer already from negotiate_fetch */
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);
}
@@ -526,8 +526,7 @@ int git_smart__download_pack(
}
} while (1);
- if ((error = writepack->commit(writepack, stats)) < 0)
- goto done;
+ error = writepack->commit(writepack, stats);
done:
if (writepack)
@@ -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) {
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();
error = GIT_EUSER;
}
@@ -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);
}
- if (push->status.length &&
- (error = update_refs_from_report(&t->refs, &push->specs, &push->status)) < 0)
- goto done;
+ if (push->status.length)
+ error = update_refs_from_report(&t->refs, &push->specs, &push->status);
done:
git_buf_free(&pktline);
diff --git a/tests-clar/online/push.c b/tests-clar/online/push.c
index cef3959..4c2bec7 100644
--- a/tests-clar/online/push.c
+++ b/tests-clar/online/push.c
@@ -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)
{
int *was_called = (int *) payload;
+ GIT_UNUSED(stage); GIT_UNUSED(current); GIT_UNUSED(total);
*was_called = 1;
return 0;
}
@@ -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)
{
int *was_called = (int *) payload;
+ GIT_UNUSED(current); GIT_UNUSED(total); GIT_UNUSED(bytes);
*was_called = 1;
return 0;
}