Re: [PATCH 2/3] merge-ort: shuffle the computation and cleanup of potential collisions
Jonathan Tan <jonathantanmy@google.com> writes:
Show 12 quoted lines
> "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> 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