On Thu Aug 6, 2020 at 5:00 PM EDT, Junio C Hamano wrote: > At first glance, it feels somewhat sad that this check is not done > in check_preimage(); after all, the caller of check_preimage() feeds > it to all kind of patches, without excluding path creation, so the > helper should be allowed to say "heh, you are trying to create path > F with this patch, but there already is F in the index", "you are > renaming into F but there is F already", etc. I spent some time trying to put it in there before deciding it was better off in check_to_create(). > It is somewhat unsatisfactory that we need to do the same > index_name_pos probing twice. I wonder if we somehow can > consolidate them? > > Perhaps something along this line, instead of this patch? I think this logic can be consolidated and still readable, yeah. I'll send a patch.