]> git.ipfire.org Git - thirdparty/git.git/blob - t/t5405-send-pack-rewind.sh
tests: mark tests relying on the current default for `init.defaultBranch`
[thirdparty/git.git] / t / t5405-send-pack-rewind.sh
1 #!/bin/sh
2
3 test_description='forced push to replace commit we do not have'
4
5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
8 . ./test-lib.sh
9
10 test_expect_success setup '
11
12 >file1 && git add file1 && test_tick &&
13 git commit -m Initial &&
14 git config receive.denyCurrentBranch warn &&
15
16 mkdir another && (
17 cd another &&
18 git init &&
19 git fetch --update-head-ok .. master:master
20 ) &&
21
22 >file2 && git add file2 && test_tick &&
23 git commit -m Second
24
25 '
26
27 test_expect_success 'non forced push should die not segfault' '
28
29 (
30 cd another &&
31 test_must_fail git push .. master:master
32 )
33
34 '
35
36 test_expect_success 'forced push should succeed' '
37
38 (
39 cd another &&
40 git push .. +master:master
41 )
42
43 '
44
45 test_done