Download raw body.
readdir() checks for . and ..
On Sat, May 31, 2025 at 07:37:32PM +0200, Omar Polo wrote: > decided to take a look due to other patches in other places :) > > out of these, the only place where I feel like the "." and ".." checks > were missing is in write_tree() -- all the others use > got_repo_is_packidx_filename() which will obviously fail for those > entries. > > what do you think? The loop in write_tree you are modifying is iterating over a custom path list which uses selected dirents at specific offsets. The . and .. entries were already filtered out when this list was built in the loop above. The directory's contents should remain the same until we close our directory handle. As for the other places, sure. I don't see harm in adding those checks. They seem idiomatic and I suppose some readers of this code will be expecting to see them.
readdir() checks for . and ..