Ma'asros, Chapter 3, Mishnah 3. Before us is another Mishnah, very similar to the previous one, dealing with a person who hires a worker to labor in his olive grove - but not for the olive harvest itself.
One who hires a worker among the olives:
Had the worker been hired to pick the olives, he would be entitled by Torah law to eat from them while he works, and such eating is exempt from ma'aser. But here we are speaking of a worker hired for some other task among the olives; the Bartenura suggests that he is hoeing beneath them or weeding beneath them. Either way, he is working in the field where the olives are, but the picking itself is not part of his job.
Therefore, if the worker stipulated and said: "I agree to work for you on condition that while I work I may take some of those olives for myself" - the olives come to him in exchange for his wages, and their status is that of a purchase. For that reason, plucking from the tree is considered a kind of miniature harvest, which obligates tithing before eating:
"Kotef echad echad" - he picks them one at a time: exempt from the obligations of ma'aser, and he is permitted to eat.
He combined two or more - obligated, and he must tithe the olives before eating them.
One who does work among the onions:
The same law applies to a worker hired to weed around the onions. Had he been picking onions, he would have been permitted to benefit from them; but here we are speaking of a secondary task in the onion bed alone. Therefore, if the worker stipulated that he would work in the onion field weeding, on condition that he be permitted to benefit from the greens - the shoots and green leaves that come up from the onions - this is in exchange for his wages, and the law is the same as in the previous case.
And what constitutes combining with regard to those green leaves that come up from the onion?
"Mekartem aleh aleh" - he plucks one green leaf at a time and eats it, and he is exempt from tithing.
He combined two leaves or more - obligated, for combining is a form of harvesting, and he must tithe before eating.
In summary: in both cases, a worker who stipulated that he may eat from the produce while doing work that does not entitle him to eat by Torah law - the produce comes into his hand as payment, and its status is that of a purchase. As long as he takes them one at a time, or plucks one leaf at a time, he is exempt from ma'aser; once he combines two or more, it becomes like harvesting, and he must tithe before he eats.