Maj. Gen. Asif Ghafoor, a military spokesman, said in a Twitter message that the army rejected Mr. Sharif’s effort, and insisted he make public the results of an investigation into the leaks and put its recommendations into effect.