]> git.99rst.org Git - git.git/commit
bundle-uri: stop sending invalid bundle configuration
authorJustin Tobler <redacted>
Wed, 8 Jul 2026 15:03:35 +0000 (17:03 +0200)
committerJunio C Hamano <redacted>
Wed, 8 Jul 2026 20:54:16 +0000 (13:54 -0700)
commit50de1169e4bf5cff947e10f64e9855669fdd2849
tree627c035f72f93f1a1d2ab337849aed6d1d8eb4a0
parent8585c50b05c46f0b5d604a404273705a724b19f5
bundle-uri: stop sending invalid bundle configuration

When bundle-URI info is requested by the client, the server responds
with all "bundle.*" config lines as key=value packet lines. On the
client-side, the received bundle config packet lines are always expected
to contain both a key and a value otherwise the client errors out during
parsing. The server performs no validation of the read bundle
configuration though which results in any misconfiguration on the
server-side, such as bundle configuration with an empty value, being
blindly sent to the client.

To avoid having the server transmit invalid configuration to clients,
only send bundle configuration that has non-empty values.

This change makes bundle-URI information sent by the server
syntactically correct, but semantically it still can be invalid. For
example the server may end up sending `bundle.bundle-1.creationToken`,
but be lacking a `bundle.bundle-1.uri` for that bundle. The `uri` is
mandatory, thus the client cannot process this bundle and will error
with the message:

    error: bundle 'bundle-1' has no uri

Fixing this would require a more complex solution, because bundles need
to be validated as a whole and not line-by-line. This is considered
outside the scope of this change.

Co-authored-by: Toon Claes <redacted>
Signed-off-by: Justin Tobler <redacted>
Signed-off-by: Toon Claes <redacted>
Signed-off-by: Junio C Hamano <redacted>
bundle-uri.c
t/lib-bundle-uri-protocol.sh
git clone https://git.99rst.org/PROJECT