Drupal Commerce, TeamCity and Git Submodules

At Headscape we use TeamCity as our Continuous Integration server and I recently came across an error when trying to build Drupal Commerce Kickstart.

The main parts of the error message were

Failed to build patch for build... due to error: 'build patch' command failed.

stderr: The repository has a submodule in the commit '77b28273d1ebb08fd03ee254bbb20b6b476d16ec' at a path 'profiles/commerce_kickstart/libraries/jquery.bxslider', but has no .gitmodules configuration at the root directory