diff --git a/pkg/common/git.go b/pkg/common/git.go index c87906a..b1e1f54 100644 --- a/pkg/common/git.go +++ b/pkg/common/git.go @@ -376,6 +376,13 @@ func NewGitCloneExecutor(input NewGitCloneExecutorInput) Executor { } logger.Debugf("Cloned %s to %s", input.URL, input.Dir) + if hash.String() != input.Ref && refType == "branch" { + logger.Debugf("Provided ref is not a sha. Updating branch ref after pull") + if hash, err = r.ResolveRevision(rev); err != nil { + logger.Errorf("Unable to resolve %s: %v", input.Ref, err) + return err + } + } if err = w.Checkout(&git.CheckoutOptions{ Hash: *hash, Force: true,