Commit 7baa7631eab48fba1427b0c7b4b109da09dd050b

Jameson Miller 2013-10-02T15:39:18

Style tweaks and changes for code review feedback

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;
 }