diff --git a/cmd/commands/repo.go b/cmd/commands/repo.go index 9a015c65..fa0b3f9c 100644 --- a/cmd/commands/repo.go +++ b/cmd/commands/repo.go @@ -165,7 +165,7 @@ func NewRepoBootstrapCommand() *cobra.Command { repo bootstrap --repo https://github.com/example/repo/path/to/installation_root `), - PreRun: func(cmd *cobra.Command, args []string) { cloneOpts.Parse() }, + PreRun: func(_ *cobra.Command, _ []string) { cloneOpts.Parse() }, RunE: func(cmd *cobra.Command, args []string) error { return RunRepoBootstrap(cmd.Context(), &RepoBootstrapOptions{ AppSpecifier: appSpecifier, diff --git a/pkg/git/repository.go b/pkg/git/repository.go index 7edbad1d..950d43b6 100644 --- a/pkg/git/repository.go +++ b/pkg/git/repository.go @@ -212,7 +212,7 @@ var clone = func(ctx context.Context, opts *CloneOptions) (*repo, error) { Progress: opts.Progress, } - log.G(ctx).WithFields(log.Fields{"url": opts.url}).Debug("cloning git repo") + log.G(ctx).WithField("url", opts.url).Debug("cloning git repo") r, err := ggClone(ctx, memory.NewStorage(), opts.FS, cloneOpts) if err != nil { return nil, err @@ -250,6 +250,7 @@ func (r *repo) checkoutRef(ref string) error { return err } + log.G().WithField("ref", ref).Debug("failed resolving ref, trying to resolve from remote branch") remotes, err := r.Remotes() if err != nil { return err @@ -271,6 +272,10 @@ func (r *repo) checkoutRef(ref string) error { return err } + log.G().WithFields(log.Fields{ + "ref": ref, + "hash": hash.String(), + }).Debug("checking out commit") return wt.Checkout(&gg.CheckoutOptions{ Hash: *hash, })