]> arthur.barton.de Git - bup.git/commit
rev_list: handle multiple results/ref from remote for custom formats
authorRob Browning <rlb@defaultvalue.org>
Sat, 13 Apr 2019 17:07:18 +0000 (12:07 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sat, 13 Apr 2019 17:07:18 +0000 (12:07 -0500)
commitd8bc5a5c33accc9c5abe249f555cd6e772ce9c52
treed71bff539db7a2b1dbaf867c6dd94c3798d4013a
parent3a66f25b253bf7790b45f5640d22298f0f00c70b
rev_list: handle multiple results/ref from remote for custom formats

Previously a remote rev_list invocation would crash if a custom format
was provided and the remote produced multiple results for any input
ref.  Change the client/server code to use a blank line to indicate
the end of the rev-list results.  Of course, that means that the parse
function provided must be able to handle (consume) any blank lines
that its format string produces, which may preclude the use of some
format strings, but should be sufficient for now.

Adjust test-ls to (trivially) cover this case, and broaden the use of
the commit hash length tests in the code.

Thanks to Alex Roper for reporting the problem, providing an easy way
to reproduce it, and proposing a fix.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
cmd/server-cmd.py
lib/bup/client.py
lib/bup/git.py
t/test-ls