merge-ort: drop unnecessary temporary in check_for_directory_rename()

check_for_directory_rename() had a weirdly coded check for whether a strmap contained a certain key. Replace the temporary variable and call to strmap_get_entry() with the more natural strmap_contains() call. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Aug 6, 2025 at 23:15 UTC edbe2abcd8411e5c6598db37ea75b5ab20027da9
1 file changed +2 -4
merge-ort.c
+2 -4
@@ -2580,7 +2580,6 @@ static char *check_for_directory_rename(struct merge_options *opt,
2580 {
2581 char *new_path;
2582 struct strmap_entry *rename_info;
2583 - struct strmap_entry *otherinfo;
2583 const char *new_dir;
2584 int other_side = 3 - side_index;
2585
@@ -2615,14 +2614,13 @@ static char *check_for_directory_rename(struct merge_options *opt,
2614 * to not let Side1 do the rename to dumbdir, since we know that is
2615 * the source of one of our directory renames.
2616 *
2618 - * That's why otherinfo and dir_rename_exclusions is here.
2617 + * That's why dir_rename_exclusions is here.
2618 *
2619 * As it turns out, this also prevents N-way transient rename
2620 * confusion; See testcases 9c and 9d of t6423.
2621 */
2622 new_dir = rename_info->value; /* old_dir = rename_info->key; */
2624 - otherinfo = strmap_get_entry(dir_rename_exclusions, new_dir);
2625 - if (otherinfo) {
2623 + if (strmap_contains(dir_rename_exclusions, new_dir)) {
2624 path_msg(opt, INFO_DIR_RENAME_SKIPPED_DUE_TO_RERENAME, 1,
2625 rename_info->key, path, new_dir, NULL,
2626 _("WARNING: Avoiding applying %s -> %s rename "