diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-22 09:42:18 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-22 09:42:18 +0200 |
| commit | aa557d16f24a0a1fd8751ac702ea6bff7b5fa4aa (patch) | |
| tree | dda9551537f088464694a213181cfc1d8ccb8004 /internal/git/git.go | |
| parent | 830b314656b0353e6a52652b650b686edfefa97a (diff) | |
Implement git package with full test coverage incl Sync (task 355)
Diffstat (limited to 'internal/git/git.go')
| -rw-r--r-- | internal/git/git.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/git/git.go b/internal/git/git.go index 1680561..af4a394 100644 --- a/internal/git/git.go +++ b/internal/git/git.go @@ -72,6 +72,12 @@ func (g *Git) Sync(ctx context.Context, syncRepos []string) error { // run executes a git command in the given directory, printing each line of // combined stdout+stderr with a "> " prefix so the user can follow progress. // It returns an error if the command exits with a non-zero status. +// +// Output is intentionally buffered: all output is captured into a bytes.Buffer +// and printed only after the subprocess exits. This matches the Ruby reference +// implementation (which uses backtick capture) and keeps the "> " prefix logic +// simple. For long-running operations like git pull the user sees no output +// until the command completes — an acceptable tradeoff for a personal tool. func run(ctx context.Context, dir string, args ...string) error { cmd := exec.CommandContext(ctx, args[0], args[1:]...) cmd.Dir = dir |
