mktree: do not check type of remote objects
[git/debian.git] / t / t5405-send-pack-rewind.sh
blob11f03239a0628c4a50ef13758647f6c85e35e552
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-lib.sh
10 test_expect_success setup '
12 >file1 && git add file1 && test_tick &&
13 git commit -m Initial &&
14 git config receive.denyCurrentBranch warn &&
16 mkdir another && (
17 cd another &&
18 git init &&
19 git fetch --update-head-ok .. main:main
20 ) &&
22 >file2 && git add file2 && test_tick &&
23 git commit -m Second
27 test_expect_success 'non forced push should die not segfault' '
30 cd another &&
31 test_must_fail git push .. main:main
36 test_expect_success 'forced push should succeed' '
39 cd another &&
40 git push .. +main:main
45 test_done