diff --git a/pkg/common/git/git.go b/pkg/common/git/git.go index 706f9ca..3c5af7b 100644 --- a/pkg/common/git/git.go +++ b/pkg/common/git/git.go @@ -330,7 +330,7 @@ func NewGitCloneExecutor(input NewGitCloneExecutorInput) common.Executor { logger.Errorf("Unable to resolve %s: %v", input.Ref, err) } - if hash.String() != input.Ref && strings.HasPrefix(hash.String(), input.Ref) { + if hash.String() != input.Ref && len(input.Ref) >= 4 && strings.HasPrefix(hash.String(), input.Ref) { return &Error{ err: ErrShortRef, commit: hash.String(),