3 test_description='git rebase - test patch id computation'
5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
23 test_expect_success 'setup' '
24 git commit --allow-empty -m initial &&
28 test_expect_success 'setup: 500 lines' '
29 rm -f .gitattributes &&
30 git checkout -q -f main &&
31 git reset --hard root &&
34 git commit -q -m initial &&
35 git branch -f other &&
39 git commit -q -m "change big file" &&
41 git checkout -q other &&
44 git commit -q -m "add small file" &&
46 git cherry-pick main >/dev/null 2>&1
49 test_expect_success 'setup attributes' '
50 echo "file binary" >.gitattributes
53 test_expect_success 'detect upstream patch' '
54 git checkout -q main &&
57 git commit -q -m "change big file again" &&
58 git checkout -q other^{} &&
60 git rev-list main...HEAD~ >revs &&
61 test_must_be_empty revs
64 test_expect_success 'do not drop patch' '
65 git branch -f squashed main &&
66 git checkout -q -f squashed &&
67 git reset -q --soft HEAD~2 &&
68 git commit -q -m squashed &&
69 git checkout -q other^{} &&
70 test_must_fail git rebase squashed &&