On Sun Nov 24, 2024 at 1:27 PM CST, phillip.wood123 wrote: > On 23/11/2024 05:41, Caleb White wrote: >> Yes, there is an edge case that a file is written with the same (correct) >> contents, but I think this is acceptable given that it would be more >> complicated to check if the contents are the same before writing (which >> would involve reading the file). > > That's fine - it might be worth explaining it in the commit message > though (the same goes for the other patches where we start writing both > files instead of one). I can make a note of it in the commit messages. >>> This works because strbuf_realpath() copies dotgit.buf before it resets >>> dotgit but that does not seem to be documented and looking at the output of >>> >>> git grep strbuf_realpath | grep \\.buf >>> >>> I don't see any other callers relying on this outside of your earlier >>> changes to this file. Given that I wonder if we should leave it as is >>> which would also simplify this patch as the interesting changes are >>> swamped by the strbuf tweaking. >> >> I'd like to keep this if that's okay. > > Let's leave it as is and see what Junio thinks - my worry is that if > strbuf_realpath() gets refactored in the future it could break this code. The tests will catch any breakages during a refactor, so I'm not too worried about that. Best, Caleb