Start the 2.48 cycle
[alt-git.git] / t / t9850-shell.sh
blobf503f16d1b6a417bc7c7d160cc69433efa082b34
1 #!/bin/sh
3 test_description='git shell tests'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
8 test_expect_success 'shell allows upload-pack' '
9 printf 0000 >input &&
10 git upload-pack . <input >expect &&
11 git shell -c "git-upload-pack $SQ.$SQ" <input >actual &&
12 test_cmp expect actual
15 test_expect_success 'shell forbids other commands' '
16 test_must_fail git shell -c "git config foo.bar baz"
19 test_expect_success 'shell forbids interactive use by default' '
20 test_must_fail git shell
23 test_expect_success 'shell allows interactive command' '
24 mkdir git-shell-commands &&
25 write_script git-shell-commands/ping <<-\EOF &&
26 echo pong
27 EOF
28 echo pong >expect &&
29 echo ping | git shell >actual &&
30 test_cmp expect actual
33 test_expect_success 'shell complains of overlong commands' '
34 perl -e "print \"a\" x 2**12 for (0..2**19)" |
35 test_must_fail git shell 2>err &&
36 grep "too long" err
39 test_done