diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-02 03:22:31 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-02 03:22:31 +0800 |
commit | 6cabefd826686a9636200a050829d5aef8c87014 (patch) | |
tree | 7892ae003f22d15858be516f897fc6a24327e1ea | |
parent | LMTP: Stub patch application (diff) | |
download | forge-6cabefd826686a9636200a050829d5aef8c87014.tar.gz forge-6cabefd826686a9636200a050829d5aef8c87014.tar.zst forge-6cabefd826686a9636200a050829d5aef8c87014.zip |
LMTP: Fix mistake in command arguments
-rw-r--r-- | lmtp_handle_patch.go | 5 |
1 files changed, 4 insertions, 1 deletions
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") |