It is not true at all. A list of a few atheists in foxholes:
http://militaryatheists.org/atheists-in-foxholes/Example:Air Force Lieutenant Colonel Christine LegawiecBoard MemberSpecialty: C-130 PilotDates of Service: 1996-presentDecorations: Aerial Achievement, Meritorious Service, GWOT ServiceTours of duty: Kuwait, 2000; Balkans, 2000-2005; OEF, 2001-2005; OIF, 2003-2004, ONE, 2008No atheists in foxholes? Really? So when things get tough I'm supposed to forget my training, put away my courage and just pray? No way. I have to count on me, on my crew, and on my fellow service members to do our jobs to the best of our ability. Our lives depend on it. If you stop performing the mission to pray, you are putting all of us at risk.