summaryrefslogtreecommitdiff
path: root/send-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-08-15 12:23:51 -0700
committerJunio C Hamano <gitster@pobox.com>2014-09-15 13:23:19 -0700
commitab2b0c908aa1d1643fb15ffca4b943c3add9b945 (patch)
tree55f70dfb2f8dbff6a0670f74494e5bb57f4915ef /send-pack.c
parent52d2ae582e84c6d4ace8ab7e021808915148816a (diff)
downloadgit-ab2b0c908aa1d1643fb15ffca4b943c3add9b945.tar.gz
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 <gitster@pobox.com>
Diffstat (limited to 'send-pack.c')
-rw-r--r--send-pack.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/send-pack.c b/send-pack.c
index 0cb44aba94..716c11bbdc 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -220,7 +220,7 @@ int send_pack(struct send_pack_args *args,
struct strbuf req_buf = STRBUF_INIT;
struct strbuf cap_buf = STRBUF_INIT;
struct ref *ref;
- int new_refs;
+ int need_pack_data = 0;
int allow_deleting_refs = 0;
int status_report = 0;
int use_sideband = 0;
@@ -276,13 +276,12 @@ int send_pack(struct send_pack_args *args,
/*
* Finally, tell the other end!
*/
- new_refs = 0;
for (ref = remote_refs; ref; ref = ref->next) {
if (!ref_update_to_be_sent(ref, args))
continue;
if (!ref->deletion)
- new_refs++;
+ need_pack_data = 1;
if (args->dry_run) {
ref->status = REF_STATUS_OK;
@@ -327,7 +326,7 @@ int send_pack(struct send_pack_args *args,
in = demux.out;
}
- if (new_refs && cmds_sent) {
+ if (need_pack_data && cmds_sent) {
if (pack_objects(out, remote_refs, extra_have, args) < 0) {
for (ref = remote_refs; ref; ref = ref->next)
ref->status = REF_STATUS_NONE;