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
11 test_expect_success setup
'
13 >file1 && git add file1 && test_tick &&
14 git commit -m Initial &&
15 git config receive.denyCurrentBranch warn &&
20 git fetch --update-head-ok .. main:main
23 >file2 && git add file2 && test_tick &&
28 test_expect_success
'non forced push should die not segfault' '
32 test_must_fail git push .. main:main
37 test_expect_success
'forced push should succeed' '
41 git push .. +main:main