mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-03 20:02:04 +00:00
protocol: don't store flushes
Storing flushes in the refs vector doesn't let us recognize when the remote is empty, as we'd always introduce at least one element into it. These flushes aren't necessary, so we can simply ignore them.
This commit is contained in:
parent
f9cf12b4f5
commit
22935b06d1
@ -45,11 +45,13 @@ int git_protocol_store_refs(git_transport *t, int flushes)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (git_vector_insert(refs, pkt) < 0)
|
||||
if (pkt->type != GIT_PKT_FLUSH && git_vector_insert(refs, pkt) < 0)
|
||||
return -1;
|
||||
|
||||
if (pkt->type == GIT_PKT_FLUSH)
|
||||
if (pkt->type == GIT_PKT_FLUSH) {
|
||||
flush++;
|
||||
git_pkt_free(pkt);
|
||||
}
|
||||
} while (flush < flushes);
|
||||
|
||||
return flush;
|
||||
|
Loading…
Reference in New Issue
Block a user