Karthik Nayak's patch addresses a side effect of 0e358de64a, which made fetch use batched reference updates for performance. The same batching covers both the fetched references and the tag backfill. Because the batch isn't committed to disk when backfilling starts, the client may have no references to advertise in the 'haves' during negotiation, for example in shallow fetches. Since backfilling doesn't use a depth limit, the server may then send objects the client already has.

The fix commits the previous batched update before starting the tag backfill. In the thread, Nayak agreed with a point from Junio C Hamano that the problem only exists when the main fetch actually updates on-disk state. If no refs were updated, there was nothing to use in negotiation anyway. He said he would adjust a code comment that was inaccurate in saying it would report no refs, since it only fails to report refs that are not yet committed.

On --atomic, Nayak said the issue always existed there because both the regular ref updates and the tag updates need to go in one transaction. He said there is not much that can be done, but he will mention it in the commit message. In response to another review point, he agreed to separate retcode from a new backfill_retcode.

He also said that while testing further he realized something else, but the excerpt cuts off before saying what. A revised version is expected.