From 1b6d6ed3d76119fb5c545c92a2cd3752c2f20e6f Mon Sep 17 00:00:00 2001 From: Andrew Cassidy Date: Sat, 18 Oct 2025 23:55:55 -0700 Subject: [PATCH] fix indents --- act/common/git/git.go | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/act/common/git/git.go b/act/common/git/git.go index 38ce18bb..2f8815b5 100644 --- a/act/common/git/git.go +++ b/act/common/git/git.go @@ -282,13 +282,13 @@ func CloneIfRequired(ctx context.Context, refName plumbing.ReferenceName, input } } - logger.Debugf("Cloned %s to %s", input.URL, input.Dir) - return r, nil + logger.Debugf("Cloned %s to %s", input.URL, input.Dir) + return r, nil } func gitOptions(token string) (fetchOptions git.FetchOptions, pullOptions git.PullOptions) { fetchOptions.RefSpecs = []config.RefSpec{"refs/*:refs/*", "HEAD:refs/heads/HEAD"} - fetchOptions.Force = true + fetchOptions.Force = true pullOptions.Force = true if token != "" { @@ -337,13 +337,12 @@ func NewGitCloneExecutor(input NewGitCloneExecutorInput) common.Executor { } var hash *plumbing.Hash - rev := plumbing.Revision(input.Ref) + rev := plumbing.Revision(input.Ref) if hash, err = r.ResolveRevision(rev); err != nil { logger.Errorf("Unable to resolve %s: %v", input.Ref, err) - return err + return err } - if hash.String() != input.Ref && len(input.Ref) >= 4 && strings.HasPrefix(hash.String(), input.Ref) { return &Error{ err: ErrShortRef, @@ -351,16 +350,16 @@ func NewGitCloneExecutor(input NewGitCloneExecutorInput) common.Executor { } } - var head *plumbing.Reference - if head, err = r.Head(); err != nil { - logger.Errorf("Unable to get repository head") - return err - } + var head *plumbing.Reference + if head, err = r.Head(); err != nil { + logger.Errorf("Unable to get repository head") + return err + } - if head.Hash() == *hash { - // HEAD is already at the target hash, so we don't have to do anything - return err - } + if head.Hash() == *hash { + // HEAD is already at the target hash, so we don't have to do anything + return err + } // At this point we need to know if it's a tag or a branch // And the easiest way to do it is duck typing