Skip to content

Commit

Permalink
Use a better name for git exec
Browse files Browse the repository at this point in the history
  • Loading branch information
chainchad committed Dec 9, 2024
1 parent 25864d1 commit 4be3d94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions tools/gomod-local-update/internal/updater/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ type gitExecutor interface {
Command(ctx context.Context, args ...string) ([]byte, error)
}

// realGitExecutor implements actual git command execution
type realGitExecutor struct{}
// systemGitExecutor executes git commands on the host system
type systemGitExecutor struct{}

func (g *realGitExecutor) Command(ctx context.Context, args ...string) ([]byte, error) {
func (g *systemGitExecutor) Command(ctx context.Context, args ...string) ([]byte, error) {
return exec.CommandContext(ctx, "git", args...).Output()
}

Expand Down Expand Up @@ -61,7 +61,7 @@ func New(config *Config, system SystemOperator) *Updater {
return &Updater{
config: config,
system: system,
git: &realGitExecutor{},
git: &systemGitExecutor{},
}
}

Expand Down
2 changes: 1 addition & 1 deletion tools/gomod-local-update/internal/updater/updater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"time"
)

// mockGitExecutor simulates git commands for testing
// mockGitExecutor simulates git commands for testing as an alternative to systemGitExecutor
type mockGitExecutor struct {
sha string
time time.Time
Expand Down

0 comments on commit 4be3d94

Please sign in to comment.