3 test_description
='git rebase - test patch id computation'
7 test -n "$GIT_PATCHID_TIMING_TESTS" && test_set_prereq EXPENSIVE
33 /usr
/bin
/time "$@" >/dev
/null
36 test_expect_success
'setup' '
37 git commit --allow-empty -m initial &&
44 test_expect_success
$pr "setup: $nlines lines" "
45 rm -f .gitattributes &&
46 git checkout -q -f master &&
47 git reset --hard root &&
48 count $nlines >file &&
50 git commit -q -m initial &&
51 git branch -f other &&
55 git commit -q -m 'change big file' &&
57 git checkout -q other &&
60 git commit -q -m 'add small file' &&
62 git cherry-pick master >/dev/null 2>&1
66 run git diff master^\!
69 test_expect_success
$pr 'setup attributes' "
70 echo 'file binary' >.gitattributes
74 run git format-patch --stdout master &&
75 run git format-patch --stdout --ignore-if-in-upstream master
78 test_expect_success
$pr 'detect upstream patch' "
79 git checkout -q master &&
82 git commit -q -m 'change big file again' &&
83 git checkout -q other^{} &&
85 test_must_fail test -n \"\$(git rev-list master...HEAD~)\"
88 test_expect_success
$pr 'do not drop patch' "
89 git branch -f squashed master &&
90 git checkout -q -f squashed &&
91 git reset -q --soft HEAD~2 &&
92 git commit -q -m squashed &&
93 git checkout -q other^{} &&
94 test_must_fail git rebase squashed &&
95 rm -rf .git/rebase-apply
100 do_tests
50000 EXPENSIVE