]> git.ipfire.org Git - thirdparty/git.git/blame - t/t9850-shell.sh
The third batch
[thirdparty/git.git] / t / t9850-shell.sh
CommitLineData
32696a4c
JK
1#!/bin/sh
2
3test_description='git shell tests'
4. ./test-lib.sh
5
6test_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
11'
12
13test_expect_success 'shell forbids other commands' '
14 test_must_fail git shell -c "git config foo.bar baz"
15'
16
17test_expect_success 'shell forbids interactive use by default' '
18 test_must_fail git shell
19'
20
21test_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
29'
30
71ad7fe1
JK
31test_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
35'
36
32696a4c 37test_done