Only the Brave(1930)

Cooper is a Union Army officer who after being jilted by girlfriend, Virginia Bruce, volunteers on what could be a suicide mission. He volunteers to go behind enemy lines disguised in Confederate gray as a staff officer to Robert E. Lee. He's to ride to a certain plantation which is a local brigade headquarters and deliberately let himself by caught with maps showing false Union troop dispositions. Of course the penalty then as now is execution.