Git 2.30.9
[git.git] / t / t9850-shell.sh
blobcfc71c3bd4318758570f0aa7206d63fa71fedb4e
1 #!/bin/sh
3 test_description='git shell tests'
4 . ./test-lib.sh
6 test_expect_success 'shell allows upload-pack' '
7 printf 0000 >input &&
8 git upload-pack . <input >expect &&
9 git shell -c "git-upload-pack $SQ.$SQ" <input >actual &&
10 test_cmp expect actual
13 test_expect_success 'shell forbids other commands' '
14 test_must_fail git shell -c "git config foo.bar baz"
17 test_expect_success 'shell forbids interactive use by default' '
18 test_must_fail git shell
21 test_expect_success 'shell allows interactive command' '
22 mkdir git-shell-commands &&
23 write_script git-shell-commands/ping <<-\EOF &&
24 echo pong
25 EOF
26 echo pong >expect &&
27 echo ping | git shell >actual &&
28 test_cmp expect actual
31 test_expect_success 'shell complains of overlong commands' '
32 perl -e "print \"a\" x 2**12 for (0..2**19)" |
33 test_must_fail git shell 2>err &&
34 grep "too long" err
37 test_done