@@ -17,100 +17,100 @@ test_expect_success setup '
17
17
commit1=$(echo modify | git commit-tree $tree1 -p $commit0) &&
18
18
git update-ref refs/heads/master $commit0 &&
19
19
git update-ref refs/heads/tofail $commit1 &&
20
- git clone ./. victim &&
21
- GIT_DIR=victim/ .git git update-ref refs/heads/tofail $commit1 &&
20
+ git clone --bare ./. victim.git &&
21
+ GIT_DIR=victim.git git update-ref refs/heads/tofail $commit1 &&
22
22
git update-ref refs/heads/master $commit1 &&
23
23
git update-ref refs/heads/tofail $commit0
24
24
'
25
25
26
- cat > victim/ .git/hooks/pre-receive << 'EOF '
26
+ cat > victim.git/hooks/pre-receive << 'EOF '
27
27
#!/bin/sh
28
28
printf %s "$@" >>$GIT_DIR/pre-receive.args
29
29
cat - >$GIT_DIR/pre-receive.stdin
30
30
echo STDOUT pre-receive
31
31
echo STDERR pre-receive >&2
32
32
EOF
33
- chmod u+x victim/ .git/hooks/pre-receive
33
+ chmod u+x victim.git/hooks/pre-receive
34
34
35
- cat > victim/ .git/hooks/update << 'EOF '
35
+ cat > victim.git/hooks/update << 'EOF '
36
36
#!/bin/sh
37
37
echo "$@" >>$GIT_DIR/update.args
38
38
read x; printf %s "$x" >$GIT_DIR/update.stdin
39
39
echo STDOUT update $1
40
40
echo STDERR update $1 >&2
41
41
test "$1" = refs/heads/master || exit
42
42
EOF
43
- chmod u+x victim/ .git/hooks/update
43
+ chmod u+x victim.git/hooks/update
44
44
45
- cat > victim/ .git/hooks/post-receive << 'EOF '
45
+ cat > victim.git/hooks/post-receive << 'EOF '
46
46
#!/bin/sh
47
47
printf %s "$@" >>$GIT_DIR/post-receive.args
48
48
cat - >$GIT_DIR/post-receive.stdin
49
49
echo STDOUT post-receive
50
50
echo STDERR post-receive >&2
51
51
EOF
52
- chmod u+x victim/ .git/hooks/post-receive
52
+ chmod u+x victim.git/hooks/post-receive
53
53
54
- cat > victim/ .git/hooks/post-update << 'EOF '
54
+ cat > victim.git/hooks/post-update << 'EOF '
55
55
#!/bin/sh
56
56
echo "$@" >>$GIT_DIR/post-update.args
57
57
read x; printf %s "$x" >$GIT_DIR/post-update.stdin
58
58
echo STDOUT post-update
59
59
echo STDERR post-update >&2
60
60
EOF
61
- chmod u+x victim/ .git/hooks/post-update
61
+ chmod u+x victim.git/hooks/post-update
62
62
63
63
test_expect_success push '
64
- test_must_fail git send-pack --force ./victim/ .git \
64
+ test_must_fail git send-pack --force ./victim.git \
65
65
master tofail >send.out 2>send.err
66
66
'
67
67
68
68
test_expect_success ' updated as expected' '
69
- test $(GIT_DIR=victim/ .git git rev-parse master) = $commit1 &&
70
- test $(GIT_DIR=victim/ .git git rev-parse tofail) = $commit1
69
+ test $(GIT_DIR=victim.git git rev-parse master) = $commit1 &&
70
+ test $(GIT_DIR=victim.git git rev-parse tofail) = $commit1
71
71
'
72
72
73
73
test_expect_success ' hooks ran' '
74
- test -f victim/ .git/pre-receive.args &&
75
- test -f victim/ .git/pre-receive.stdin &&
76
- test -f victim/ .git/update.args &&
77
- test -f victim/ .git/update.stdin &&
78
- test -f victim/ .git/post-receive.args &&
79
- test -f victim/ .git/post-receive.stdin &&
80
- test -f victim/ .git/post-update.args &&
81
- test -f victim/ .git/post-update.stdin
74
+ test -f victim.git/pre-receive.args &&
75
+ test -f victim.git/pre-receive.stdin &&
76
+ test -f victim.git/update.args &&
77
+ test -f victim.git/update.stdin &&
78
+ test -f victim.git/post-receive.args &&
79
+ test -f victim.git/post-receive.stdin &&
80
+ test -f victim.git/post-update.args &&
81
+ test -f victim.git/post-update.stdin
82
82
'
83
83
84
84
test_expect_success ' pre-receive hook input' '
85
85
(echo $commit0 $commit1 refs/heads/master;
86
86
echo $commit1 $commit0 refs/heads/tofail
87
- ) | test_cmp - victim/ .git/pre-receive.stdin
87
+ ) | test_cmp - victim.git/pre-receive.stdin
88
88
'
89
89
90
90
test_expect_success ' update hook arguments' '
91
91
(echo refs/heads/master $commit0 $commit1;
92
92
echo refs/heads/tofail $commit1 $commit0
93
- ) | test_cmp - victim/ .git/update.args
93
+ ) | test_cmp - victim.git/update.args
94
94
'
95
95
96
96
test_expect_success ' post-receive hook input' '
97
97
echo $commit0 $commit1 refs/heads/master |
98
- test_cmp - victim/ .git/post-receive.stdin
98
+ test_cmp - victim.git/post-receive.stdin
99
99
'
100
100
101
101
test_expect_success ' post-update hook arguments' '
102
102
echo refs/heads/master |
103
- test_cmp - victim/ .git/post-update.args
103
+ test_cmp - victim.git/post-update.args
104
104
'
105
105
106
106
test_expect_success ' all hook stdin is /dev/null' '
107
- ! test -s victim/ .git/update.stdin &&
108
- ! test -s victim/ .git/post-update.stdin
107
+ ! test -s victim.git/update.stdin &&
108
+ ! test -s victim.git/post-update.stdin
109
109
'
110
110
111
111
test_expect_success ' all *-receive hook args are empty' '
112
- ! test -s victim/ .git/pre-receive.args &&
113
- ! test -s victim/ .git/post-receive.args
112
+ ! test -s victim.git/pre-receive.args &&
113
+ ! test -s victim.git/post-receive.args
114
114
'
115
115
116
116
test_expect_success ' send-pack produced no output' '
0 commit comments