From c93630ece1ee9b1811dbfefc7c27ddc3c222cf10 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Fri, 5 May 2023 11:33:47 -0400 Subject: [PATCH] fix(server): wait for and ensure git command exits We have to wait for exec.Command to exit Fixes: https://github.com/charmbracelet/soft-serve/issues/262 --- server/git/git.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/git/git.go b/server/git/git.go index 5a49b3dc41f7e71b488ec3f511d1d665aa2a3a29..0b14f0b5031901b2b4299d87981f43134509edb9 100644 --- a/server/git/git.go +++ b/server/git/git.go @@ -136,11 +136,11 @@ func RunGit(ctx context.Context, in io.Reader, out io.Writer, er io.Writer, dir }) if err := errg.Wait(); err != nil { - logger.Error("while running git command", "err", err) - return err + logger.Error("while copying output", "err", err) } - return nil + // Wait for the command to finish + return c.Wait() } // WritePktline encodes and writes a pktline to the given writer.