Actually, Ford ad-libbed that scene and the other actor played along. He was actually supposed to fight the swordsman with his whip. But Ford was so sick with food poisoning (along with most of the cast and crew) that he didn’t have the energy so he just shot. And it became an iconic scene.
Wow, what a story. Great scene even without that story.