1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-09 18:46:11 +02:00

merge-ort: small cleanups of check_for_directory_rename

No functional changes, just some preparatory cleanups.

Suggested-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Elijah Newren <newren@palantir.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Elijah Newren 2022-07-05 01:33:40 +00:00 committed by Junio C Hamano
parent 0565cee5e4
commit 51e41e4eaf

View File

@ -2267,18 +2267,17 @@ static char *check_for_directory_rename(struct merge_options *opt,
struct strmap *collisions, struct strmap *collisions,
int *clean_merge) int *clean_merge)
{ {
char *new_path = NULL; char *new_path;
struct strmap_entry *rename_info; struct strmap_entry *rename_info;
struct strmap_entry *otherinfo = NULL; struct strmap_entry *otherinfo;
const char *new_dir; const char *new_dir;
/* Cases where we don't have a directory rename for this path */
if (strmap_empty(dir_renames)) if (strmap_empty(dir_renames))
return new_path; return NULL;
rename_info = check_dir_renamed(path, dir_renames); rename_info = check_dir_renamed(path, dir_renames);
if (!rename_info) if (!rename_info)
return new_path; return NULL;
/* old_dir = rename_info->key; */
new_dir = rename_info->value;
/* /*
* This next part is a little weird. We do not want to do an * This next part is a little weird. We do not want to do an
@ -2304,6 +2303,7 @@ static char *check_for_directory_rename(struct merge_options *opt,
* As it turns out, this also prevents N-way transient rename * As it turns out, this also prevents N-way transient rename
* confusion; See testcases 9c and 9d of t6043. * confusion; See testcases 9c and 9d of t6043.
*/ */
new_dir = rename_info->value; /* old_dir = rename_info->key; */
otherinfo = strmap_get_entry(dir_rename_exclusions, new_dir); otherinfo = strmap_get_entry(dir_rename_exclusions, new_dir);
if (otherinfo) { if (otherinfo) {
path_msg(opt, rename_info->key, 1, path_msg(opt, rename_info->key, 1,