From fea2ecd327eafaa81b8ff03aefe81a7a36c068eb Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 24 Mar 2015 18:56:32 -0300 Subject: Ensure the submodule has a branch at module-update --- share/hydra/module-update | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/hydra/module-update b/share/hydra/module-update index f4c70c7..0a9fc1a 100755 --- a/share/hydra/module-update +++ b/share/hydra/module-update @@ -34,7 +34,16 @@ function hydra_module_update { fi # Update the module - ( cd $PUPPET/modules/$MODULE; git pull ) + ( + cd $PUPPET/modules/$MODULE + + # Ensure the submodule has a branch + if git branch | grep -q "(no branch)"; then + git checkout master + fi + + git pull + ) # Verify the module if ! hydra $HYDRA module-verify $MODULE; then -- cgit v1.2.3