diff options
author | Jonathan Tan <jonathantanmy@google.com> | 2017-12-14 13:44:45 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-12-14 14:28:04 -0800 |
commit | e967ca38473a05abf3e8f7a025c6b9bee487aa4f (patch) | |
tree | 1954c9a0a80d1f44f9e5d5c2a75d042f7591b99d /tree.c | |
parent | 245abe34ac0622b349470b89d4b76a082a133cab (diff) | |
download | git-jt/transport-hide-vtable.tar.gz |
transport: make transport vtable more privatejt/transport-hide-vtable
Move the definition of the transport-specific functions provided by
transports, whether declared in transport.c or transport-helper.c, into
an internal header. This means that transport-using code (as opposed to
transport-declaring code) can no longer access these functions (without
importing the internal header themselves), making it clear that they
should use the transport_*() functions instead, and also allowing the
interface between the transport mechanism and an individual transport to
independently evolve.
This is superficially a reversal of commit 824d5776c3f2 ("Refactor
struct transport_ops inlined into struct transport", 2007-09-19).
However, the scope of the involved variables was neither affected nor
discussed in that commit, and I think that the advantages in making
those functions more private outweigh the advantages described in that
commit's commit message. A minor additional point is that the code has
gotten more complicated since then, in that the function-pointer
variables are potentially mutated twice (once initially and once if
transport_take_over() is invoked), increasing the value of corralling
them into their own struct.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree.c')
0 files changed, 0 insertions, 0 deletions