Add the garlic (if using) and curry leaves and cook for 10 seconds before adding the tomatoes. Cook for 7 minutes. Add the sugar and cook for a minute before adding back in the cooked eggplant.
Meanwhile, make the green curry: in a saute pan, sweat the onion in the remaining olive oil over very gentle heat. When, after about 10 minutes, it starts to soften and become translucent ...