# Re: \[PATCH v4 2/2\] merge-ort: return early when failing to write a blob

- From: Junio C Hamano \<hidden\>
- Date: 2022-09-26 22:08:03 
- List: git
- Page: https://ratatoskr.run/git/2022/09/7956727
- Thread: https://ratatoskr.run/git/2022/09/7956727/t.md

```text
"Johannes Schindelin via GitGitGadget" [ref]
writes:

> From: Johannes Schindelin <redacted>
>
> In the previous commit, we fixed a segmentation fault when a tree object
> could not be written.
>
> However, before the tree object is written, `merge-ort` wants to write
> out a blob object (except in cases where the merge results in a blob
> that already exists in the database). And this can fail, too, but we
> ignore that write failure so far.

Nice find.

As long as we create at least one "new" blob the repository has not
seen, we have a chance to exit before we attempt to write a tree
object (and notice a failure).  Checking the return value of
process_entry() for failures is a good thing to do.

Will replace.  Thanks.
```
