Skip to content

Commit ab2b0c9

Browse files
committed
send-pack: rename "new_refs" to "need_pack_data"
The variable counts how many non-deleting command is being sent, but is only checked with 0-ness to decide if we need to send the pack data. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 52d2ae5 commit ab2b0c9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

send-pack.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ int send_pack(struct send_pack_args *args,
220220
struct strbuf req_buf = STRBUF_INIT;
221221
struct strbuf cap_buf = STRBUF_INIT;
222222
struct ref *ref;
223-
int new_refs;
223+
int need_pack_data = 0;
224224
int allow_deleting_refs = 0;
225225
int status_report = 0;
226226
int use_sideband = 0;
@@ -276,13 +276,12 @@ int send_pack(struct send_pack_args *args,
276276
/*
277277
* Finally, tell the other end!
278278
*/
279-
new_refs = 0;
280279
for (ref = remote_refs; ref; ref = ref->next) {
281280
if (!ref_update_to_be_sent(ref, args))
282281
continue;
283282

284283
if (!ref->deletion)
285-
new_refs++;
284+
need_pack_data = 1;
286285

287286
if (args->dry_run) {
288287
ref->status = REF_STATUS_OK;
@@ -327,7 +326,7 @@ int send_pack(struct send_pack_args *args,
327326
in = demux.out;
328327
}
329328

330-
if (new_refs && cmds_sent) {
329+
if (need_pack_data && cmds_sent) {
331330
if (pack_objects(out, remote_refs, extra_have, args) < 0) {
332331
for (ref = remote_refs; ref; ref = ref->next)
333332
ref->status = REF_STATUS_NONE;

0 commit comments

Comments
 (0)