Skip to content

Commit

Permalink
fixed PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ATGardner committed Jun 17, 2021
1 parent 9916d57 commit 99cbb38
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/commands/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func NewRepoBootstrapCommand() *cobra.Command {
<BIN> 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,
Expand Down
7 changes: 6 additions & 1 deletion pkg/git/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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,
})
Expand Down

0 comments on commit 99cbb38

Please sign in to comment.