Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions serve.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ static int promisor_remote_advertise(struct repository *r,
static void promisor_remote_receive(struct repository *r,
const char *remotes)
{
if (!remotes)
die("promisor-remote capability requires an argument");

mark_promisor_remotes_as_accepted(r, remotes);
}

Expand Down
11 changes: 11 additions & 0 deletions t/t5701-git-serve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ test_expect_success 'request invalid capability' '
test_grep "unknown capability" err
'

test_expect_success 'promisor-remote capability requires an argument' '
test-tool pkt-line pack >in <<-EOF &&
command=ls-refs
object-format=$(test_oid algo)
promisor-remote
0000
EOF
test_must_fail test-tool serve-v2 --stateless-rpc 2>err <in &&
test_grep "promisor-remote capability requires an argument" err
'

test_expect_success 'request with no command' '
test-tool pkt-line pack >in <<-EOF &&
agent=git/test
Expand Down
Loading