Skip to content

Commit 51e41e4

Browse files
newrengitster
authored andcommitted
merge-ort: small cleanups of check_for_directory_rename
No functional changes, just some preparatory cleanups. Suggested-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0565cee commit 51e41e4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

merge-ort.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2267,18 +2267,17 @@ static char *check_for_directory_rename(struct merge_options *opt,
22672267
struct strmap *collisions,
22682268
int *clean_merge)
22692269
{
2270-
char *new_path = NULL;
2270+
char *new_path;
22712271
struct strmap_entry *rename_info;
2272-
struct strmap_entry *otherinfo = NULL;
2272+
struct strmap_entry *otherinfo;
22732273
const char *new_dir;
22742274

2275+
/* Cases where we don't have a directory rename for this path */
22752276
if (strmap_empty(dir_renames))
2276-
return new_path;
2277+
return NULL;
22772278
rename_info = check_dir_renamed(path, dir_renames);
22782279
if (!rename_info)
2279-
return new_path;
2280-
/* old_dir = rename_info->key; */
2281-
new_dir = rename_info->value;
2280+
return NULL;
22822281

22832282
/*
22842283
* 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,
23042303
* As it turns out, this also prevents N-way transient rename
23052304
* confusion; See testcases 9c and 9d of t6043.
23062305
*/
2306+
new_dir = rename_info->value; /* old_dir = rename_info->key; */
23072307
otherinfo = strmap_get_entry(dir_rename_exclusions, new_dir);
23082308
if (otherinfo) {
23092309
path_msg(opt, rename_info->key, 1,

0 commit comments

Comments
 (0)