Roofing shingles are attached to roofs with nails, and the trick is to place those nails where the shingle above will cover them. When you install a roof from scratch, this is easy, as you simply cover the nails holding the bottom shingles with the shingle above it.
When it comes to doing a roof repair, though, all bets are off. In the best-case scenario, no nails should be left exposed. Sometimes, however, repairs do have to leave a few nails exposed. Placing a dab of roof cement over the heads of these nails is always a good idea.
In your case, driving nails through the middle of 40 shingles seems unusual and excessive. I would contact the roofing contractor and tell him you are concerned that the repair is not going to hold because of the way it was done. A good contractor will make an attempt to keep his or her customer happy, and either explain why the repair was done the way it was or come back and change it.
If you can't reach the contractor or they refuse to address the roof repair problems, your only options are legal and then things get really messy. You'd need an opinion from another expert as to what was wrong with the first repair and then you both have to go to court to prove the first roofer's work was substandard. As you might guess, by the time you do all of this, it would be cheaper just to pay somebody else to do the roof repair all over again. Thanks for listening and we hope this helps!