blob 7c70d45057551f1d4434b12c65aae29d7eb178a9 1017 bytes (raw)
name: t/t5411/test-0002-pre-receive-declined.sh # note: path name is non-authoritative(*)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
| | test_expect_success "setup pre-receive hook ($PROTOCOL)" '
mv "$upstream/hooks/pre-receive" "$upstream/hooks/pre-receive.ok" &&
write_script "$upstream/hooks/pre-receive" <<-EOF
exit 1
EOF
'
# Refs of upstream : main(A)
# Refs of workbench: main(A) tags/v123
# git-push : main(B) next(A)
test_expect_success "git-push is declined ($PROTOCOL)" '
test_must_fail git -C workbench push origin \
$B:refs/heads/main \
HEAD:refs/heads/next \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
# Prevent accidential changes by the internal "receive-pack" process.
rm out &&
cat >expect <<-EOF &&
To <URL/of/upstream.git>
! [remote rejected] <COMMIT-B> -> main (pre-receive hook declined)
! [remote rejected] HEAD -> next (pre-receive hook declined)
EOF
test_cmp expect actual &&
test_cmp_refs -C "$upstream" <<-EOF
<COMMIT-A> refs/heads/main
EOF
'
test_expect_success "cleanup ($PROTOCOL)" '
mv "$upstream/hooks/pre-receive.ok" "$upstream/hooks/pre-receive"
'
|
debug log:
solving 7c70d45057 ...
found 7c70d45057 in https://public-inbox.org/git/20210118133011.15331-2-worldhello.net@gmail.com/
found 61c3ee1b7f in https://public-inbox.org/git/20210118133011.15331-1-worldhello.net@gmail.com/
found e7d113a158 in https://80x24.org/mirrors/git.git
preparing index
index prepared:
100644 e7d113a1587bbb2734e0850ba2341eb452eac090 t/t5411/test-0002-pre-receive-declined.sh
applying [1/2] https://public-inbox.org/git/20210118133011.15331-1-worldhello.net@gmail.com/
diff --git a/t/t5411/test-0002-pre-receive-declined.sh b/t/t5411/test-0002-pre-receive-declined.sh
index e7d113a158..61c3ee1b7f 100644
applying [2/2] https://public-inbox.org/git/20210118133011.15331-2-worldhello.net@gmail.com/
diff --git a/t/t5411/test-0002-pre-receive-declined.sh b/t/t5411/test-0002-pre-receive-declined.sh
index 61c3ee1b7f..7c70d45057 100644
Checking patch t/t5411/test-0002-pre-receive-declined.sh...
Applied patch t/t5411/test-0002-pre-receive-declined.sh cleanly.
Checking patch t/t5411/test-0002-pre-receive-declined.sh...
Applied patch t/t5411/test-0002-pre-receive-declined.sh cleanly.
index at:
100644 7c70d45057551f1d4434b12c65aae29d7eb178a9 t/t5411/test-0002-pre-receive-declined.sh
(*) Git path names are given by the tree(s) the blob belongs to.
Blobs themselves have no identifier aside from the hash of its contents.^
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).