diff options
| author | Elijah Newren <newren@gmail.com> | 2025-08-06 23:15:17 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-08-07 13:23:58 -0700 |
| commit | edbe2abcd8411e5c6598db37ea75b5ab20027da9 (patch) | |
| tree | 02e5b6333847bb4aec48bad38d21c6175659bf78 | |
| parent | merge-ort: update comments to modern testfile location (diff) | |
| download | git-edbe2abcd8411e5c6598db37ea75b5ab20027da9.tar.gz git-edbe2abcd8411e5c6598db37ea75b5ab20027da9.zip | |
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>
| -rw-r--r-- | merge-ort.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/merge-ort.c b/merge-ort.c index d87ba6dd42..9b9d82ed10 100644 --- a/merge-ort.c +++ b/merge-ort.c @@ -2580,7 +2580,6 @@ static char *check_for_directory_rename(struct merge_options *opt, { char *new_path; struct strmap_entry *rename_info; - struct strmap_entry *otherinfo; const char *new_dir; int other_side = 3 - side_index; @@ -2615,14 +2614,13 @@ static char *check_for_directory_rename(struct merge_options *opt, * to not let Side1 do the rename to dumbdir, since we know that is * the source of one of our directory renames. * - * That's why otherinfo and dir_rename_exclusions is here. + * That's why dir_rename_exclusions is here. * * As it turns out, this also prevents N-way transient rename * confusion; See testcases 9c and 9d of t6423. */ new_dir = rename_info->value; /* old_dir = rename_info->key; */ - otherinfo = strmap_get_entry(dir_rename_exclusions, new_dir); - if (otherinfo) { + if (strmap_contains(dir_rename_exclusions, new_dir)) { path_msg(opt, INFO_DIR_RENAME_SKIPPED_DUE_TO_RERENAME, 1, rename_info->key, path, new_dir, NULL, _("WARNING: Avoiding applying %s -> %s rename " |
