Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t5405-send-pack-rewind.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t5405-send-pack-rewind.sh` 45 lines ยท 732 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='forced push to replace commit we do not have' 4 5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main 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 .. main:main 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 .. main:main 32 ) 33 34 ' 35 36 test_expect_success 'forced push should succeed' ' 37 38 ( 39 cd another && 40 git push .. +main:main 41 ) 42 43 ' 44 45 test_done