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
10 test_expect_success setup '
12 >file1 && git add file1 && test_tick &&
13 git commit -m Initial &&
14 git config receive.denyCurrentBranch warn &&
19 git fetch --update-head-ok .. main:main
22 >file2 && git add file2 && test_tick &&
27 test_expect_success 'non forced push should die not segfault' '
31 test_must_fail git push .. main:main
36 test_expect_success 'forced push should succeed' '
40 git push .. +main:main