Control of gearshifts on dual-clutch transmissions during the inertia phase