Only update submodules if the source is in a git repo

This change just adds a check to verify that the build is happening
inside a git repo and that git is a valid command before trying
to update the submodules.

Use 'command -v' instead of 'which' to stay portable.

Change-Id: Idfa27645c3dbfd684f90002ecb01626d71eacc8f
Signed-off-by: Martin Roth <>
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <>
Reviewed-by: Paul Menzel <>
1 file changed