On Tue, Jun 7, 2022 at 3:44 AM Junio C Hamano <gitster@xxxxxxxxx> wrote: > > > > "freshen_packed_object()" or "freshen_loose_object()" will be called > > inside "stream_loose_object()" after obtaining the "oid". > > That much we can read from the patch text. Saying just "we do X" > without explaining "why we do so" in the proposed log message leaves > readers more confused than otherwise. Why is it worth pointing out > in the proposed log message? Is the reason why we need to do so > involve something tricky? > Yes, it really should be made clear why this is done here. Thanks. -Han Xin > > + ret = end_loose_object_common(&c, &stream, oid); > > + if (ret != Z_OK) > > + die(_("deflateEnd on stream object failed (%d)"), ret); > > + close_loose_object(fd, tmp_file.buf); > > + > > + if (freshen_packed_object(oid) || freshen_loose_object(oid)) { > > + unlink_or_warn(tmp_file.buf); > > + goto cleanup; > > So, we were told to write an object, we wrote to a temporary file, > and we wanted to mark the object to be recent and found that there > indeed is already the object. We remove the temporary and do not > leave the new copy of the object, and the value of err at this point > is 0 (success) which is what is returned from cleanup: label. > > Good. >