Start the 2.46 cycle
[git/gitster.git] / t / t5405-send-pack-rewind.sh
blob1686ac13aa628584297fcfd961356ae5291c57e7
1 #!/bin/sh
3 test_description='forced push to replace commit we do not have'
5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
8 TEST_PASSES_SANITIZE_LEAK=true
9 . ./test-lib.sh
11 test_expect_success setup '
13 >file1 && git add file1 && test_tick &&
14 git commit -m Initial &&
15 git config receive.denyCurrentBranch warn &&
17 mkdir another && (
18 cd another &&
19 git init &&
20 git fetch --update-head-ok .. main:main
21 ) &&
23 >file2 && git add file2 && test_tick &&
24 git commit -m Second
28 test_expect_success 'non forced push should die not segfault' '
31 cd another &&
32 test_must_fail git push .. main:main
37 test_expect_success 'forced push should succeed' '
40 cd another &&
41 git push .. +main:main
46 test_done