diff options
-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") |