From f1da4424bf7c5a81b7eb37093d3d7e80b76b0067 Mon Sep 17 00:00:00 2001
From: Gabriel <g2p.code@gmail.com>
Date: Mon, 22 Oct 2012 22:21:29 +0200
Subject: [PATCH] `submodule sync` won't work in a leaf submodule.

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 9da652762a7..a8c3ba59e61 100755
--- a/configure
+++ b/configure
@@ -595,7 +595,7 @@ then
     need_ok "git failed"
 
     msg "git: submodule foreach sync"
-    "${CFG_GIT}" submodule --quiet foreach --recursive git submodule sync
+    "${CFG_GIT}" submodule --quiet foreach --recursive 'if test -e .gitmodules; then git submodule sync; fi'
     need_ok "git failed"
 
     msg "git: submodule foreach update"