From 6cabefd826686a9636200a050829d5aef8c87014 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Wed, 2 Apr 2025 03:22:31 +0800 Subject: LMTP: Fix mistake in command arguments --- lmtp_handle_patch.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lmtp_handle_patch.go') diff --git a/lmtp_handle_patch.go b/lmtp_handle_patch.go index 4e49d55..138b592 100644 --- a/lmtp_handle_patch.go +++ b/lmtp_handle_patch.go @@ -63,13 +63,16 @@ func lmtpHandlePatch(session *lmtpSession, groupPath []string, repoName string, if err = gitdiff.Apply(&patchedBuf, sourceBuf, diffFile); err != nil { return err } - proc := exec.CommandContext(session.ctx, "git", "hash-object", "w", "-t", "blob", "--stdin") + proc := exec.CommandContext(session.ctx, "git", "hash-object", "-w", "-t", "blob", "--stdin") proc.Env = append(os.Environ(), "GIT_DIR="+fsPath) proc.Stdout = &hashBuf proc.Stdin = &patchedBuf if err = proc.Start(); err != nil { return err } + if err = proc.Wait(); err != nil { + return err + } newHash := hashBuf.Bytes() if len(newHash) != 20*2+1 { // TODO: Hardcoded from the size of plumbing.Hash panic("unexpected hash size") -- cgit v1.2.3