From: Calvin Wan Date: Mon, 27 Jun 2022 21:04:06 GMT Subject: Re: [PATCH 2/3] merge-ort: shuffle the computation and cleanup of potential collisions Message-ID: <20220627210406.2802452-1-calvinwan@google.com> In-Reply-To: <20220627184847.1361980-1-jonathantanmy@google.com> Jonathan Tan writes: > "Elijah Newren via GitGitGadget" writes: > > @@ -2314,7 +2335,8 @@ static char *check_for_directory_rename(struct merge_options *opt, > > } > > > > new_path = handle_path_level_conflicts(opt, path, side_index, > > - rename_info, collisions); > > + rename_info, > > + &collisions[side_index]); > > Is this a fix of a latent bug? handle_path_level_conflicts() is not > changed in this patch. > I don't think so. IIUC this is what's happening given the callstack: detect_and_process_renames() - Now defines `struct strmap collisions[3];` and computes all three collisions here - Passes collisions into collect_renames() collect_renames() - Originally defined as `struct strmap collisions;` and computed collisions in here - Now takes collisions as an argument - Passes collisions into check_for_directory_rename() check_for_directory_rename() - Collisions isn't used in this function at all except to pass into handle_path_level_conflicts handle_path_level_conflicts() - Expecting pointer to singular collisions, not an array so side_index is now required