File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -169,5 +169,39 @@ check_equal "$(git log --pretty=format:'%s' HEAD^2 | grep -i split)" ""
169169# meaningless to subproj since one side of the merge refers to the mainline)
170170check_equal " $( git log --pretty=format:' %s%n%b' HEAD^2 | grep ' git-subtree.*:' ) " " "
171171
172+ # make sure no patch changes more than one file. The original set of commits
173+ # changed only one file each. A multi-file change would imply that we pruned
174+ # commits too aggressively.
175+ joincommits ()
176+ {
177+ echo " hello world"
178+ commit=
179+ all=
180+ while read x y; do
181+ echo " {$x }" >&2
182+ if [ -z " $x " ]; then
183+ continue
184+ elif [ " $x " = " commit:" ]; then
185+ if [ -n " $commit " ]; then
186+ echo " $commit $all "
187+ all=
188+ fi
189+ commit=" $y "
190+ else
191+ all=" $all $y "
192+ fi
193+ done
194+ echo " $commit $all "
195+ }
196+ x=0
197+ git log --pretty=format:' commit: %H' | joincommits |
198+ ( while read commit a b; do
199+ echo " Verifying commit $commit "
200+ check_equal " $b " " "
201+ x=$(( $x + 1 ))
202+ done
203+ check_equal $x 23
204+ ) || exit 1
205+
172206echo
173207echo ' ok'
You can’t perform that action at this time.
0 commit comments