From a17b30c654fdac332a835c07d4dd782d92cb37c4 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 26 Jun 2019 18:30:10 -0700 Subject: [PATCH] Fetch submodules regardless of whether the repo has a ref attached Since 20aa65c0ee, instead of cloning with --recursive, submodules are updated after the correct ref is checked out. However, it was doing so *only* when a ref is specified. --- worker/tasks.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/worker/tasks.go b/worker/tasks.go index 960071f..dd0886d 100644 --- a/worker/tasks.go +++ b/worker/tasks.go @@ -343,15 +343,15 @@ func (ctx *JobContext) CloneRepos() error { if err := git.Run(); err != nil { return errors.Wrap(err, "git checkout") } - git = ctx.SSH("GIT_SSH_COMMAND='ssh -o " + - "UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'", - "sh", "-euxc", - fmt.Sprintf("'cd %s && git submodule update --init'", repo_name)) - git.Stdout = ctx.LogFile - git.Stderr = ctx.LogFile - if err := git.Run(); err != nil { - return errors.Wrap(err, "git submodule update") - } + } + git = ctx.SSH("GIT_SSH_COMMAND='ssh -o " + + "UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'", + "sh", "-euxc", + fmt.Sprintf("'cd %s && git submodule update --init'", repo_name)) + git.Stdout = ctx.LogFile + git.Stderr = ctx.LogFile + if err := git.Run(); err != nil { + return errors.Wrap(err, "git submodule update") } } else if scm == "hg" { repo_name := path.Base(purl.Path) -- 2.38.5