3 test_description
='git rebase - test patch id computation'
7 test_set_prereq NOT_EXPENSIVE
8 test -n "$GIT_PATCHID_TIMING_TESTS" && test_set_prereq EXPENSIVE
9 test -x /usr
/bin
/time && test_set_prereq USR_BIN_TIME
31 done < "$1" > "$1.new"
38 /usr
/bin
/time "$@" >/dev
/null
41 test_expect_success
'setup' '
42 git commit --allow-empty -m initial
51 test_expect_success
$pr "setup: $nlines lines" "
52 rm -f .gitattributes &&
53 git checkout -q -f master &&
54 git reset --hard root &&
55 count $nlines >file &&
57 git commit -q -m initial &&
58 git branch -f other &&
62 git commit -q -m 'change big file' &&
64 git checkout -q other &&
67 git commit -q -m 'add small file' &&
69 git cherry-pick master >/dev/null 2>&1
73 run git diff master^\!
76 test_expect_success
$pr 'setup attributes' "
77 echo 'file binary' >.gitattributes
81 run git format-patch --stdout master &&
82 run git format-patch --stdout --ignore-if-in-upstream master
85 test_expect_success
$pr 'detect upstream patch' "
86 git checkout -q master &&
89 git commit -q -m 'change big file again' &&
90 git checkout -q other^{} &&
92 test_must_fail test -n \"\$(git rev-list master...HEAD~)\"
95 test_expect_success
$pr 'do not drop patch' "
96 git branch -f squashed master &&
97 git checkout -q -f squashed &&
98 git reset -q --soft HEAD~2 &&
99 git commit -q -m squashed &&
100 git checkout -q other^{} &&
101 test_must_fail git rebase squashed &&
102 rm -rf .git/rebase-apply
106 do_tests NOT_EXPENSIVE
500
107 do_tests EXPENSIVE
50000