From: Stefan Beller Date: Wed, 15 Nov 2017 20:23:50 GMT Subject: Re: [PATCH 27/30] merge-recursive: Apply necessary modifications for directory renames Message-ID: In-Reply-To: <20171110190550.27059-28-newren@gmail.com> > + if (!strcmp(pair->one->path, pair->two->path)) { > + /* > + * Paths should only match if this was initially a > + * non-rename that is being turned into one by > + * directory rename detection. > + */ > + assert(pair->status != 'R'); > + } else { > + assert(pair->status == 'R'); assert() is compiled conditionally depending on whether NDEBUG is set, which makes potential error reports more interesting and head-scratching. But we'd rather prefer easy bug reports, therefore we'd want to (a) either have the condition checked always, when you know this could occur, e.g. via if () BUG("Git is broken, because..."); or (b) you could omit the asserts if they are more of a developer guideline? I wonder if we want to introduce a BUG_ON(, ) macro that contains (a). > + re->dst_entry->processed = 1; > + //string_list_remove(entries, pair->two->path, 0); commented code?