build: Check if .git exists at all, rather than just as a dir

We were failing to do a proper submodule init/update round during our continuous
package builds, which was causing whole build failures.

Change-Id: I42cd29321c1d0ea953abd92c47cec3839d1b43e9
diff --git a/packages.mk b/packages.mk
index 5a5f366..378e6f2 100644
--- a/packages.mk
+++ b/packages.mk
@@ -73,7 +73,11 @@
 
 	$(LOG) $1 pbuilder
 	$(ROOTDIR)/build/update_packages.sh
-	if [ -d $(ROOTDIR)/$2/.git ]; then cd $(ROOTDIR)/$2; git submodule init; git submodule update; fi
+	if [[ -e $(ROOTDIR)/$2/.git ]]; then \
+		cd $(ROOTDIR)/$2; \
+		git submodule init; \
+		git submodule update; \
+	fi
 	rm -rf $(PRODUCT_OUT)/obj/$1
 	mkdir -p $(PRODUCT_OUT)/obj/$1
 	rsync -a --exclude .git/ $(ROOTDIR)/$2/* $(PRODUCT_OUT)/obj/$1