Grind the garlic and ginger to a paste in a mortar.
Heat the oil in a wok over medium heat and stir-fry the onion until golden, about 5 minutes. Add the garlic-ginger paste, all the spices and the curry leaves, and continue to stir-fry gently for 4 to 5 minutes.
Add the potatoes and stir-fry until they are well-coated with the spices, about 1 minute.